Class: Lafcadio::MonthField
- Inherits:
-
DateField
- Object
- ObjectField
- DateField
- Lafcadio::MonthField
- Defined in:
- lib/lafcadio/objectField/MonthField.rb
Overview
Accepts a Month as a value. This field automatically saves in MySQL as a date corresponding to the first day of the month.
Constant Summary
Constants inherited from DateField
DateField::RANGE_NEAR_FUTURE, DateField::RANGE_PAST
Instance Attribute Summary
Attributes inherited from DateField
Attributes inherited from ObjectField
#dbFieldName, #default, #defaultFieldName, #hideDisplay, #hideLabel, #name, #notNull, #notUniqueMsg, #objectType, #unique, #writeOnce
Class Method Summary collapse
-
.valueType ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#valueForSQL(value) ⇒ Object
:nodoc:.
Methods inherited from DateField
Methods inherited from ObjectField
#<=>, #bind_write?, #dbWillAutomaticallyWrite, #db_table_and_field_name, #englishName, #firstTime, #initialize, instantiateFromXml, instantiateWithParameters, instantiationParameters, #nameForSQL, #nullErrorMsg, #prevValue, #processBeforeVerify, #valueFromSQL, #verify, #verifyUniqueness
Constructor Details
This class inherits a constructor from Lafcadio::DateField
Class Method Details
.valueType ⇒ Object
:nodoc:
8 9 10 |
# File 'lib/lafcadio/objectField/MonthField.rb', line 8 def MonthField.valueType #:nodoc: Month end |
Instance Method Details
#valueForSQL(value) ⇒ Object
:nodoc:
12 13 14 |
# File 'lib/lafcadio/objectField/MonthField.rb', line 12 def valueForSQL(value) #:nodoc: "'#{value.year}-#{value.month}-01'" end |