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

Fix created_at being set to nil during a non-timeless call

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • None

      If an existing document has timeless.save called on it and then a document in that collection is created with Collection.create, the second document will not get a created_at timestamp.

      The original implementation assumed that clear_timeless_option would be called once for each timestamp module it included. However, it is only called once during an update since the create callback does not get called.

      This implementation adds an alternate clear_timeless_option that will get called if the document is already persisted and decrements the counter for each timestamp module that is included since it will only be called once (by the update callback).

            Assignee:
            Unassigned Unassigned
            Reporter:
            kcdragon kcdragon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: