1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

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

View file

@ -70,6 +70,18 @@ if defined? ActiveRecord
assert @users.out_of_range? assert @users.out_of_range?
end 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 test 'regression: call arel first' do
@users = User.page(1).without_count @users = User.page(1).without_count
@users.arel @users.arel