instance method
attribute_will_change!
Ruby on Rails 4.1.16
Since v3.0.20 PrivateSignature
attribute_will_change!(attr)
Handle *_will_change! for method_missing.
Parameters
-
attrreq
Source
# File activemodel/lib/active_model/dirty.rb, line 185
def attribute_will_change!(attr)
return if attribute_changed?(attr)
begin
value = __send__(attr)
value = value.duplicable? ? value.clone : value
rescue TypeError, NoMethodError
end
changed_attributes[attr] = value
end
Defined in activemodel/lib/active_model/dirty.rb line 185
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Dirty