delete_all on STI models

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 6.1.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      STI delete_all works fine on 2 layers STI

      class P
        include Mongoid::Document
      end
      
      class C < P
      end
      
      > P.delete_all  #   MOPED: 127.0.0.1:27017 DELETE       database=xxx_development collection=ps selector={} flags=[]
      

      but some problem occurred on 3 layers STI

      class GF
        include Mongoid::Document
      end
      
      class P < GF
      end
      
      class C < P
      end
      
      > P.delete_all  #    MOPED: 127.0.0.1:27017 DELETE       database=xxx_development collection=gfs selector={:_type=>"P"} flags=[]
      

      Invoking P.delete_all only delete all documents of type P but I would like to delete all documents of type P and C
      Is this issue by design or bug ?

              Assignee:
              Emily Stolfo (Inactive)
              Reporter:
              chenghung
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: