Class: String

Inherits:
Object show all
Defined in:
lib/mongo_record/base.rb

Instance Method Summary collapse

Instance Method Details

#to_oidObject

Convert this String to an ObjectID.



24
25
26
# File 'lib/mongo_record/base.rb', line 24

def to_oid
  Mongo::ObjectID.legal?(self) ? Mongo::ObjectID.from_string(self) : self
end