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

Clarify whether :touch option is applicable for all updates

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 8.1.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible

      https://www.mongodb.com/docs/mongoid/master/reference/associations/#touching says:

      > Any belongs_to association can take an optional :touch option which will cause the parent document be touched whenever the child document is touched:

      "touched" is subsequently defined as calling `band.touch`.

      Per our investigation it appears that the parent is touched whenever the child is saved (i.e. modified in any way, not necessarily touched), such that the correct wording would be:

      > Any belongs_to association can take an optional :touch option which will cause the parent document be touched whenever the child document is updated:

      As part of this ticket we should also verify there is test coverage for a non-touch update followed by timestamp check on the parent.

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: