method
changed?
v8.1.1 -
Show latest stable
- Class:
ActiveModel::AttributeMutationTracker
changed?(attr_name, from: OPTION_NOT_GIVEN, to: OPTION_NOT_GIVEN)public
No documentation available.
# File activemodel/lib/active_model/attribute_mutation_tracker.rb, line 44
def changed?(attr_name, from: OPTION_NOT_GIVEN, to: OPTION_NOT_GIVEN)
attribute_changed?(attr_name) &&
(OPTION_NOT_GIVEN == from || original_value(attr_name) == type_cast(attr_name, from)) &&
(OPTION_NOT_GIVEN == to || fetch_value(attr_name) == type_cast(attr_name, to))
end