Skip to content

Commit 6d7baa5

Browse files
committed
Fix #items_in_collection? for SELECT with DISTINCT.
Calling .exists? would do "select distinct (1)" preventing page 2 from being displayed.
1 parent 65c1e4e commit 6d7baa5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/active_admin/views/pages/index.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def items_in_collection?
4343
#
4444
# If we don't reorder, there may be some columns referenced in the order
4545
# clause that requires the original select.
46-
collection.reorder("").limit(1).exists?
46+
47+
!!collection.reorder("").first
4748
end
4849

4950
def build_collection

0 commit comments

Comments
 (0)