mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
use #length for any query using just DISTINCT instead of DISTINCT ON only
This commit is contained in:
parent
85c66a3066
commit
635f6a45ff
1 changed files with 2 additions and 2 deletions
|
@ -20,8 +20,8 @@ module Kaminari
|
|||
# Remove includes only if they are irrelevant
|
||||
c = c.except(:includes) unless references_eager_loaded_tables?
|
||||
|
||||
uses_distinct_on_sql = c.to_sql =~ /DISTINCT ON/i
|
||||
if uses_distinct_on_sql
|
||||
uses_distinct_sql_statement = c.to_sql =~ /DISTINCT/i
|
||||
if uses_distinct_sql_statement
|
||||
return c.length
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue