51 52 53
# File 'lib/mongomapper/support.rb', line 51 def self.from_mongo(value) value.to_date if value.present? end
44 45 46 47 48 49
# File 'lib/mongomapper/support.rb', line 44 def self.to_mongo(value) date = Date.parse(value.to_s) Time.utc(date.year, date.month, date.day) rescue nil end