We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e78a7ee commit f2cf42fCopy full SHA for f2cf42f
lib/mongoid/scopable.rb
@@ -175,7 +175,9 @@ def scoped(options = nil)
175
def unscoped
176
if block_given?
177
without_default_scope do
178
- yield(self)
+ with_scope(nil) do
179
+ yield(self)
180
+ end
181
end
182
else
183
queryable.unscoped
spec/mongoid/scopable_spec.rb
@@ -1265,8 +1265,6 @@ class << Band
1265
let(:c1) { Band.where(active: true) }
1266
1267
it 'restores previous scope' do
1268
- pending 'MONGOID-5214'
1269
-
1270
Band.with_scope(c1) do |crit|
1271
Band.unscoped do |crit2|
1272
Mongoid::Threaded.current_scope(Band).should be nil
0 commit comments