Allow setting "store_in collection" on document subclass

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Fixed
    • Priority: Unknown
    • 8.1.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      This code raises an InvalidStorageParent error.

      class Animal
        include Mongoid::Document
      
        store_in collection: 'animals'
      end
      
      class Dog < Animal
         include Mongoid::Document
      
         store_in collection: 'dogs'  #=> raises InvalidStorageParent 
      end

      Is there any reason we have this restriction? It would be very useful to subclass a document and make it stored in a different collection.

              Assignee:
              Neil Shweky (Inactive)
              Reporter:
              Johnny Shields
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: