def reorder?
p 'it works' if self.order_num_changed?
end
当我准备在回调里调用 attribute_changed?的时候,会出来一句
DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from attribute_changed? at /Users/jiyarong/.rvm/gems/ruby-2.3.0@global/gems/activerecord-5.1.1/lib/active_record/attribute_methods/dirty.rb:225)