Module: Mongoid::Extensions::Object::ClassMethods
- Defined in:
- build/mongoid-master/lib/mongoid/extensions/object.rb
Instance Method Summary collapse
-
#__mongoize_fk__(association, object) ⇒ Object
Convert the provided object to a foreign key, given the metadata key contstraint.
-
#demongoize(object) ⇒ Object
Convert the object from its mongo friendly ruby type to this type.
-
#mongoize(object) ⇒ Object
Turn the object from the ruby type we deal with to a Mongo friendly type.
Instance Method Details
#__mongoize_fk__(association, object) ⇒ Object
Convert the provided object to a foreign key, given the metadata key contstraint.
216 217 218 219 |
# File 'build/mongoid-master/lib/mongoid/extensions/object.rb', line 216 def __mongoize_fk__(association, object) return nil if !object || object == "" association.convert_to_foreign_key(object) end |
#demongoize(object) ⇒ Object
Convert the object from its mongo friendly ruby type to this type.
229 230 231 |
# File 'build/mongoid-master/lib/mongoid/extensions/object.rb', line 229 def demongoize(object) object end |
#mongoize(object) ⇒ Object
Turn the object from the ruby type we deal with to a Mongo friendly type.
242 243 244 |
# File 'build/mongoid-master/lib/mongoid/extensions/object.rb', line 242 def mongoize(object) object.mongoize end |