Skip to content

Commit e5d581c

Browse files
committed
note a deprecated test
1 parent afc6a59 commit e5d581c

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

lib/mongoid/criteria/queryable/selectable.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,9 @@ def negating?
496496
# @example Add the $not criterion.
497497
# Person.not(name: /Bob/)
498498
#
499+
# @example Execute a $not in a where query.
500+
# Person.where(:name.not => /Bob/)
501+
#
499502
# @example Negate a Criteria instance
500503
# Person.not(Person.where(...))
501504
#

spec/mongoid/criteria/queryable/selectable_logical_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1862,9 +1862,13 @@
18621862
it_behaves_like 'returns a cloned query'
18631863
end
18641864

1865+
# This context tests a deprecated syntax and behavior, and must be
1866+
# removed when the deprecated parameterless-not syntax is removed.
18651867
context 'when the criterion are a double negative' do
18661868
let(:selection) do
1867-
query.not.where(:first.not => /1/)
1869+
Mongoid.deprecator.silence do
1870+
query.not.where(:first.not => /1/)
1871+
end
18681872
end
18691873

18701874
it 'does not double the $not selector' do

0 commit comments

Comments
 (0)