-
Type:
New Feature
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: Attributes
-
None
ActiveModel::Dirty has a nice way to check if attribute was changed from a particular value to a different particular value
person.name_changed?(from: "Uncle Bob", to: "Bob") # => true
It would be nice to support this syntax on Mongoid as well, changes should be fairly small. ActiveRecord uses a constant OPTION_NOT_GIVEN to flag when the parameters are available or not, see https://github.com/rails/rails/blob/80b9e5d7bde7b8b4c4479e20c927e9cf8fa158ac/activemodel/lib/active_model/dirty.rb#L180