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

Remove scoping inside scope

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 9.0.1
    • Affects Version/s: 9.0.0, 7.5.4, 8.0.8
    • Component/s: None
    • None
    • Ruby Drivers

      Hi,

      I need to remove a part of criteria (specifically, the default scope from mongoid_paranoia) which I'm doing by either
      users.remove_scoping(User.where(deleted_at: nil))
      or
      users.selector.delete('deleted_at')
      I wanted to extract this to a scope (with_deleted) but then it doesn't work anymore, and I was able to identify that it's caused by always merging the criteria to the default scope here].
      Not sure this is indented behavior, or if there's some way to achieve it.

            Assignee:
            jamis.buck@mongodb.com Jamis Buck
            Reporter:
            stanley90x Marek Stanczyk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: