Class: MongoRecord::PKFactory
Instance Method Summary collapse
Instance Method Details
#create_pk(row) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/mongo_record/base.rb', line 22 def create_pk(row) return row if row[:_id] row.delete(:_id) # in case it is nil row['_id'] ||= BSON::ObjectID.new row end |