📜  rails activerecord saved_change_to - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:48.446000             🧑  作者: Mango

代码示例1
saved_change_to_attribute?(attr_name, **options)

# rerurns true if attr_name value changed in the last save

=begin
Did this attribute change when we last saved?
This method is useful in after callbacks to determine if
an attribute was changed during the save that triggered the
callbacks to run. It can be invoked as saved_change_to_name?
instead of saved_change_to_attribute?("name").
=end