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

Raise if the Same Embedded Child Instance is Added Twice

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

      It could help prevent hard-to-track-down cases of accidental Mongoid misuse.

      parent = ParentDoc.new
      child = ChildDoc.new
      parent.children << child
      parent.children << child # should raise

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

              Created:
              Updated:
              Resolved: