Module: ValidatesTimeliness::ORM::ActiveRecord::ClassMethods
- Defined in:
- lib/validates_timeliness/orm/active_record.rb
Instance Method Summary collapse
- #define_attribute_methods ⇒ Object
- #timeliness_attribute_timezone_aware?(attr_name) ⇒ Boolean
- #timeliness_attribute_type(attr_name) ⇒ Object
Instance Method Details
#define_attribute_methods ⇒ Object
7 8 9 10 11 |
# File 'lib/validates_timeliness/orm/active_record.rb', line 7 def define_attribute_methods super # Define write method and before_type_cast method define_timeliness_methods(true) end |
#timeliness_attribute_timezone_aware?(attr_name) ⇒ Boolean
13 14 15 16 |
# File 'lib/validates_timeliness/orm/active_record.rb', line 13 def timeliness_attribute_timezone_aware?(attr_name) attr_name = attr_name.to_s create_time_zone_conversion_attribute?(attr_name, columns_hash[attr_name]) end |
#timeliness_attribute_type(attr_name) ⇒ Object
18 19 20 |
# File 'lib/validates_timeliness/orm/active_record.rb', line 18 def timeliness_attribute_type(attr_name) columns_hash[attr_name.to_s].type end |