instance method define_method_attribute=

Ruby on Rails 3.1.12

Since v3.0.20 Last seen in v4.2.9

Available in: v3.0.20 v3.1.12 v3.2.22.5 v4.0.13 v4.1.16 v4.2.9

Signature

define_method_attribute=(attr_name)

No documentation comment.

Parameters

attr_name req
Source
# File activerecord/lib/active_record/attribute_methods/write.rb, line 12
          def define_method_attribute=(attr_name)
            if attr_name =~ ActiveModel::AttributeMethods::COMPILABLE_REGEXP
              generated_attribute_methods.module_eval("def #{attr_name}=(new_value); write_attribute('#{attr_name}', new_value); end", __FILE__, __LINE__)
            else
              generated_attribute_methods.send(:define_method, "#{attr_name}=") do |new_value|
                write_attribute(attr_name, new_value)
              end
            end
          end

Defined in activerecord/lib/active_record/attribute_methods/write.rb line 12 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::AttributeMethods::Write::ClassMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close