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
31 32 33 34 35 36 |
# File 'lib/validates_timeliness/orm/active_record.rb', line 31 def define_attribute_methods super.tap do |attribute_methods_generated| use_before_type_cast = ValidatesTimeliness::ORM::ActiveRecord.use_plugin_cache? define_timeliness_methods use_before_type_cast end end |
#timeliness_attribute_timezone_aware?(attr_name) ⇒ Boolean
22 23 24 25 |
# File 'lib/validates_timeliness/orm/active_record.rb', line 22 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
27 28 29 |
# File 'lib/validates_timeliness/orm/active_record.rb', line 27 def timeliness_attribute_type(attr_name) columns_hash[attr_name.to_s].type end |