Method: Mongoid::Extensions::Array::ClassMethods#mongoize
- Defined in:
- lib/mongoid/extensions/array.rb
#mongoize(object) ⇒ Array | nil
Turn the object from the ruby type we deal with to a Mongo friendly type.
136 137 138 139 140 141 142 |
# File 'lib/mongoid/extensions/array.rb', line 136 def mongoize(object) return if object.nil? case object when ::Array, ::Set object.map(&:mongoize) end end |