Sha256: 0a7e9f19d8d641e81d14210d83982cf1e6fc9fc136b2098f63329e120f1ef664
Contents?: true
Size: 534 Bytes
Versions: 6
Compression:
Stored size: 534 Bytes
Contents
module Mongoid module Contexts module IdConversion protected # Convert ids from strings to +BSON::ObjectId+s def strings_to_object_ids(ids) if Array === ids ids.map {|id| string_to_object_id(id) } else string_to_object_id(ids) end end # Convert ids from strings to +BSON::ObjectId+s def string_to_object_id(id) if String === id ::BSON::ObjectId.from_string(id) else id end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems