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

AR 3.0: call the original count method if :distinct option was given

fixes #453
This commit is contained in:
Akira Matsuda 2013-11-10 08:02:49 +09:00
parent 7c228ff673
commit b2221f7b19

View file

@ -4,7 +4,7 @@ module Kaminari
# if +limit_value+ is specified, load all the records and count them
if ActiveRecord::VERSION::STRING < '3.1'
def count(column_name = nil, options = {}) #:nodoc:
limit_value ? length : super(column_name, options)
limit_value && !options[:distinct] ? length : super(column_name, options)
end
end