Skip to content

Commit

Permalink
Merge pull request activeadmin#1458 from gregbell/fix-items-in-collec…
Browse files Browse the repository at this point in the history
…tion-when-distinct

Fix #items_in_collection? for SELECT with DISTINCT.
  • Loading branch information
gregbell committed Jul 3, 2012
2 parents 65c1e4e + 6d7baa5 commit e004fdd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/active_admin/views/pages/index.rb
Expand Up @@ -43,7 +43,8 @@ def items_in_collection?
#
# If we don't reorder, there may be some columns referenced in the order
# clause that requires the original select.
collection.reorder("").limit(1).exists?

!!collection.reorder("").first
end

def build_collection
Expand Down

0 comments on commit e004fdd

Please sign in to comment.