additional packed fields to ActiveRecord::Base
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.rspec
Gemfile
Gemfile.lock
MIT-LICENSE
README.markdown
Rakefile
VERSION
packed_fields.gemspec

README.markdown

packed_fields

Wrapper of ActiveRecord::Base.serialize

example

schema

ActiveRecord::Schema.define(:version => 1) do
  create_table :mixins do |t|
    t.column :packed, :text
  end
end

model

class Mixin < ActiveRecord::Base
  packed :fields => [:foo, :bar]
end

and using

m = Mixins.new
m.foo = 'blah'
m.save #=> #<Mixin id: 1, packed: {:foo=>"blah"}>