Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/mongo_odm/core_ext/conversions.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.type_cast(value) ⇒ Object



201
202
203
204
# File 'lib/mongo_odm/core_ext/conversions.rb', line 201

def self.type_cast(value)
  return nil if value.nil?
  value.to_time
end

Instance Method Details

#to_mongoObject



206
207
208
# File 'lib/mongo_odm/core_ext/conversions.rb', line 206

def to_mongo
  self.utc
end