123456789_123456789_123456789_123456789_123456789_

Module: Mongoid::Criteria::Queryable::Extensions::Array::ClassMethods

Relationships & Source Files
Defined in: lib/mongoid/criteria/queryable/extensions/array.rb

Instance Method Summary

Instance Method Details

#evolve(object) ⇒ Object

Evolve the object when the serializer is defined as an array.

Examples:

Evolve the object.

Array.evolve(1)

Parameters:

  • object (Object)

    The object to evolve.

Returns:

  • (Object)

    The evolved object.

[ GitHub ]

  
# File 'lib/mongoid/criteria/queryable/extensions/array.rb', line 136

def evolve(object)
  case object
  when ::Array, ::Set
    object.map { |obj| obj.class.evolve(obj) }
  else
    object
  end
end