Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 654 Bytes

README.rdoc

File metadata and controls

20 lines (15 loc) · 654 Bytes

Serialized Attributes

Serialized Attributes created virtual attributes backed by a serialized hash. It works best together with github.com/jqr/typed_serialize

Example

class User < ActiveRecord::Base
  typed_serialize :meta, Hash
  serialized_attributes :meta, :name, :surname, :phone
end

u = User.new
u.meta                   # => {}
u.name = 'Federico'
u.meta                   # => { 'name' => 'federico' }
u.name                   # => 'federico'
Homepage

github.com/coderloop/serialized_attributes

License

Copyright © 2011 Coderloop Inc. <[email protected]>, released under the MIT license