Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4241

Touch with no Attribute Updates All Fields on Model

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

      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 Emily Stolfo
            Reporter:
            cfritz Conner Fritz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: