Guest User

Untitled

a guest
May 24th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. class Foo
  2. def self.to_mongo(value)
  3. # convert value to a mongo safe data type
  4. end
  5.  
  6. def self.from_mongo(value)
  7. # convert value from a mongo safe data type to your custom data type
  8. end
  9. end
  10.  
  11. class Thing
  12. include MongoMapper::Document
  13. key :name, Foo #Awesome
  14. key :count, Integer
  15. key :slug, String
  16. end
Add Comment
Please, Sign In to add comment