instance method attribute_will_change!

Ruby on Rails 5.1.7

Since v5.1.7 Last seen in v5.1.7 Private — implementation detail, not part of the public API

Signature

attribute_will_change!(attr_name)

No documentation comment.

Parameters

attr_name req
Source
# File activerecord/lib/active_record/attribute_methods/dirty.rb, line 277
        def attribute_will_change!(attr_name)
          super
          if self.class.has_attribute?(attr_name)
            mutations_from_database.force_change(attr_name)
          else
            ActiveSupport::Deprecation.warn(<<-EOW.squish)
              #{attr_name} is not an attribute known to Active Record.
              This behavior is deprecated and will be removed in the next
              version of Rails. If you'd like #{attr_name} to be managed
              by Active Record, add `attribute :#{attr_name} to your class.
            EOW
            mutations_from_database.deprecated_force_change(attr_name)
          end
        end

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

Defined in ActiveRecord::AttributeMethods::Dirty

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close