Module: Mongoid::Criteria::Queryable::Extensions::TimeWithZone::ClassMethods

Defined in:
lib/mongoid/criteria/queryable/extensions/time_with_zone.rb

Instance Method Summary collapse

Instance Method Details

#evolve(object) ⇒ Time

Evolve the object to an date.

Examples:

Evolve dates.

Evolve string dates.

Evolve date ranges.

Parameters:

  • object (Object)

    The object to evolve.

Returns:

  • (Time)

    The evolved date time.



46
47
48
49
50
51
52
53
# File 'lib/mongoid/criteria/queryable/extensions/time_with_zone.rb', line 46

def evolve(object)
  res = begin
    object.try(:__evolve_time__)
  rescue ArgumentError
    nil
  end
  res.nil? ? object : res
end