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

ObjectId doesn't update

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

      I just tried to update a ObjectId. But it just doesn't work. Here is what I am doing

      user = User.first
      user._id = BSON::ObjectId.new
      user.save!

      That returns true. But if I load the user again, it still has the old id. Is that a bug in mongoid? Or I am doing something wrong?

      Thanks.

            Assignee:
            Unassigned Unassigned
            Reporter:
            reiz Robert Reiz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: