Calling reload on a new record where the id exists in the DB should set new_record to false

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • 9.0.8
    • Affects Version/s: 9.0.8
    • Component/s: None
    • None
    • 🔵 Done
    • Fully Compatible
    • Ruby Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      We've run into an issue when reloading a document which has had it's ID set to one that matches the value of an existing document.

      Right now, when .reload is called in these circumstances, the data is pulled from the database, but the document does not update it's new_record value to false. This results in errors when trying to save, as Mongoid attempts to insert the document instead of updating the existing one.

      PR here: https://github.com/mongodb/mongoid/pull/6034

            Assignee:
            Jamis Buck
            Reporter:
            Jamis Buck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: