method

*_will_change!

Importance_1
v7.1.3.2 - Show latest stable - 0 notes - Class: ActiveModel::Dirty
*_will_change! public

This method is generated for each attribute.

If an attribute is modified in-place then make use of *_will_change! to mark that the attribute is changing. Otherwise Active Model can’t track changes to in-place attributes. Note that Active Record can detect in-place modifications automatically. You do not need to call *_will_change! on Active Record models.

person = Person.new('Sandy')
person.name_will_change!
person.name_change # => ['Sandy', 'Sandy']
Show source
Register or log in to add new notes.