54 55 56
# File 'lib/mongo_mapper/support.rb', line 54 def self.from_mongo(value) value.to_date if value.present? end
47 48 49 50 51 52
# File 'lib/mongo_mapper/support.rb', line 47 def self.to_mongo(value) date = Date.parse(value.to_s) Time.utc(date.year, date.month, date.day) rescue nil end