Class: ActiveModel::Type::Date

Inherits:
Value show all
Includes:
Helpers::Timezone
Defined in:
activemodel/lib/active_model/type/date.rb

Overview

:nodoc:

Direct Known Subclasses

ActiveRecord::Type::Date

Instance Attribute Summary

Attributes inherited from Value

#limit, #precision, #scale

Instance Method Summary collapse

Methods included from Helpers::Timezone

#default_timezone, #is_utc?

Methods inherited from Value

#==, #assert_valid_value, #binary?, #cast, #changed?, #changed_in_place?, #deserialize, #force_equality?, #hash, #initialize, #map, #serialize, #value_constructed_by_mass_assignment?

Constructor Details

This class inherits a constructor from ActiveModel::Type::Value

Instance Method Details

#typeObject



9
10
11
# File 'activemodel/lib/active_model/type/date.rb', line 9

def type
  :date
end

#type_cast_for_schema(value) ⇒ Object



13
14
15
# File 'activemodel/lib/active_model/type/date.rb', line 13

def type_cast_for_schema(value)
  value.to_s(:db).inspect
end