module GBDate::ActiveRecord::Type::Date

Public Instance Methods

fast_string_to_date(string) click to toggle source
Calls superclass method
# 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