Module: Mongoid::Extensions::Date::Conversions

Included in:
Date
Defined in:
lib/mongoid/extensions/date/conversions.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#get(value) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/mongoid/extensions/date/conversions.rb', line 6

def get(value)
  return nil if value.blank?
  if Mongoid::Config.instance.use_utc?
    value.to_date
  else
    ::Date.new(value.year, value.month, value.day)
  end
end