1. class Product < ActiveRecord::Base
  2.  
  3. attr_accessible :name, :price, :category, :descrption, :author
  4. serialize :data, ActiveRecord::Coders::Hstore
  5.  
  6. def author
  7. properties && properties["author"]
  8. end
  9.  
  10. def author=(value)
  11. self.properties = (properties || {}).merge("author" => value)
  12. end
  13. end