Skip to content

Commit

Permalink
Type cast pagy_arel_count value to integer (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainerborene authored and ddnexus committed Dec 9, 2019
1 parent 973f4fe commit cbe4a97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pagy/extras/arel.rb
Expand Up @@ -23,7 +23,7 @@ def pagy_arel_count(collection)
else
# COUNT(*) OVER ()
sql = Arel.star.count.over(Arel::Nodes::Grouping.new([]))
collection.unscope(:order).limit(1).pluck(sql).first
collection.unscope(:order).limit(1).pluck(sql).first.to_i
end
end

Expand Down

0 comments on commit cbe4a97

Please sign in to comment.