module ActiveRecord::TypedStore::Behavior::ClassMethods

Public Instance Methods

define_attribute_methods() click to toggle source
Calls superclass method
# File lib/active_record/typed_store/behavior.rb, line 8
def define_attribute_methods
  super
  define_typed_store_attribute_methods
end
define_typed_store_attribute_methods() click to toggle source
# File lib/active_record/typed_store/behavior.rb, line 18
def define_typed_store_attribute_methods
  return if @typed_store_attribute_methods_generated
  store_accessors.each do |attribute|
    define_attribute_method(attribute)
    undefine_before_type_cast_method(attribute)
  end
  @typed_store_attribute_methods_generated = true
end
undefine_before_type_cast_method(attribute) click to toggle source
# File lib/active_record/typed_store/behavior.rb, line 27
def undefine_before_type_cast_method(attribute)
  # because it mess with ActionView forms, see #14.
  method = "#{attribute}_before_type_cast"
  undef_method(method) if method_defined?(method)
end