Class: ActiveRecord::Type::Date
- Inherits:
-
Value
- Object
- Value
- ActiveRecord::Type::Date
show all
- Defined in:
- lib/active_record/type/date.rb
Overview
Instance Attribute Summary
Attributes inherited from Value
#limit, #precision, #scale
Instance Method Summary
collapse
Methods inherited from Value
#==, #binary?, #changed?, #changed_in_place?, #hash, #initialize, #number?, #text?, #type_cast_from_database, #type_cast_from_user
Instance Method Details
#klass ⇒ Object
8
9
10
|
# File 'lib/active_record/type/date.rb', line 8
def klass
::Date
end
|
#type ⇒ Object
4
5
6
|
# File 'lib/active_record/type/date.rb', line 4
def type
:date
end
|
#type_cast_for_database(value) ⇒ Object
12
13
14
|
# File 'lib/active_record/type/date.rb', line 12
def type_cast_for_database(value)
type_cast(value)
end
|
#type_cast_for_schema(value) ⇒ Object
16
17
18
|
# File 'lib/active_record/type/date.rb', line 16
def type_cast_for_schema(value)
"'#{value.to_s(:db)}'"
end
|