Make sure that `without_count` works when chained after `where`

refs #1077
This commit is contained in:
Akira Matsuda 2022-01-24 00:45:45 +09:00
parent d8ffaa413c
commit d8a1df8aa4
1 changed files with 12 additions and 0 deletions

View File

@ -70,6 +70,18 @@ if defined? ActiveRecord
assert @users.out_of_range?
end
test 'it works when chained after `where`' do
@scope = User.where.not(id: nil).page(1).without_count
@scope.each
assert_no_queries do
assert_not @scope.last_page?
end
assert_no_queries do
assert_not @scope.out_of_range?
end
end
test 'regression: call arel first' do
@users = User.page(1).without_count
@users.arel