Module: GBDate::ActiveRecord::Type::Date

Defined in:
lib/gb_date/active_record/type/date.rb

Instance Method Summary collapse

Instance Method Details

#fast_string_to_date(string) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/gb_date/active_record/type/date.rb', line 6

def fast_string_to_date(string)
  if string =~ ::ActiveRecord::ConnectionAdapters::Column::Format::NUMERIC_TIME
    ::Time.at(string.to_f).utc.to_date
  else
    super(string)
  end
end