Advertisement
Guest User

product.rb

a guest
Sep 19th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement