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

unscoped won't work chained with a scope

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

      I have a Book model with a default scope and another scope:

      default_scope where(:removed.ne => true)
      scope :modified, where(modified: true)
      If I try to get all modified objects, together with removed ones, I would try this (as per Person.unscoped.washed_up example on mongoid.org)

      Book.unscoped.modified
      but this includes the default scope no matter what I do

      => #<Mongoid::Criteria
      selector: {:removed=>

      {"$ne"=>true}

      , :modified=>true},
      options: {},
      class: Book,
      embedded: false>
      Is this a bug or the intended behavior?

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

              Created:
              Updated:
              Resolved: