Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Product < ActiveRecord::Base
- attr_accessible :name, :price, :category, :descrption, :author
- serialize :data, ActiveRecord::Coders::Hstore
- def author
- properties && properties["author"]
- end
- def author=(value)
- self.properties = (properties || {}).merge("author" => value)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement