Skip to content

coderloop/serialized_attributes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages