method
define_method_attribute=
v6.0.0 -
Show latest stable
- Class:
ActiveRecord::AttributeMethods::Write::ClassMethods
define_method_attribute=(name)private
No documentation available.
# File activerecord/lib/active_record/attribute_methods/write.rb, line 15
def define_method_attribute=(name)
ActiveModel::AttributeMethods::AttrNames.define_attribute_accessor_method(
generated_attribute_methods, name, writer: true,
) do |temp_method_name, attr_name_expr|
generated_attribute_methods.module_eval def #{temp_method_name}(value) name = #{attr_name_expr} _write_attribute(name, value) end, __FILE__, __LINE__ + 1
end
end