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 df0941f commit 0bd32b3Copy full SHA for 0bd32b3
spec/mongoid/scopable_spec.rb
@@ -1172,6 +1172,24 @@ class << Band
1172
end
1173
1174
1175
+
1176
+ context 'when nesting unsoped under with_scope' do
1177
+ let(:c1) { Band.where(active: true) }
1178
1179
+ it 'restores previous scope' do
1180
+ pending 'MONGOID-5214'
1181
1182
+ Band.with_scope(c1) do |crit|
1183
+ Band.unscoped do |crit2|
1184
+ Mongoid::Threaded.current_scope(Band).should be nil
1185
+ end
1186
1187
+ Mongoid::Threaded.current_scope(Band).selector.should == {
1188
+ 'active' => true,
1189
+ }
1190
1191
1192
1193
1194
1195
describe ".without_default_scope" do
0 commit comments