Touch with no Attribute Updates All Fields on Model

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 6.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently when calling touch without passing a field, all attributes on the model persist.

      This seems to happen on all versions of Mongo.

      Example:
      person = Person.new(name: 'Fred', updated_at: Time.now)
      person.name = 'Bob'
      person.touch
      person.reload
      person.name

      Related To Old Fix Attempt (2012):
      https://github.com/mongodb/mongoid/commit/796d4e1717f4383de3b4d3eedf1b922863d7b80e

            Assignee:
            Emily Stolfo (Inactive)
            Reporter:
            Conner Fritz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: