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

add ignore_type_attribute to configuration

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

      Setting Mongoid::Configuration.ignore_type_attribute=true will cause Mongoid to ignore the _type
      attribute on queries where normal inheritance rules would apply that criteria, and will also ignore _type when marshaling objects from the database (preferring to use the calling class instead)

      This fixes a situation I encountered wherein I was versioning document models by incrementing the module namespace they were a part of, but I wanted my existing documents to continue being fetched/queried by the new V2 document model.

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

              Created:
              Updated:
              Resolved: