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

duplicate_fields_exception option leads to STI failure

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

      When setting duplicate_fields_exception to true, one can no longer use STI. https://github.com/mongoid/mongoid/blob/master/lib/mongoid/traversable.rb#L172 tries adding a _type field to both super- and subclass. The latter fails when using the aforementioned option as https://github.com/mongoid/mongoid/blob/master/lib/mongoid/fields/validators/macro.rb#L58 will be true.

            Assignee:
            Unassigned Unassigned
            Reporter:
            niels Niels Ganser
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: