Support Dirty Tracking changed from /to

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Done
    • Priority: Minor - P4
    • 8.1.0
    • Affects Version/s: None
    • Component/s: Attributes
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • 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

            Assignee:
            Neil Shweky (Inactive)
            Reporter:
            Cyril
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: