Class: ObjectId
Class Method Summary collapse
Class Method Details
.from_mongo(value) ⇒ Object
132 133 134 |
# File 'lib/mongo_mapper/support.rb', line 132 def self.from_mongo(value) value end |
.to_mongo(value) ⇒ Object
122 123 124 125 126 127 128 129 130 |
# File 'lib/mongo_mapper/support.rb', line 122 def self.to_mongo(value) if value.blank? nil elsif value.is_a?(Mongo::ObjectID) value else Mongo::ObjectID.from_string(value.to_s) end end |