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

Casting association IDs

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

      There seems to be an issue that has become apparent with the move to ObjectIDs.

      If we have a referenced association in our document and we set the association's id manually with a string, it gets persisted as a string. With the default behaviour of using ObjectIDs, I would expect it to cast the string as an ObjectID. Is that a correct assumption or should we be casting it manually before setting the association id?

      If my assumption is correct would it be just a matter of running the setter through cast_ids! ? If so we can look at getting a patch written up.

            Assignee:
            Unassigned Unassigned
            Reporter:
            hunter Hunter Nield
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: