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:
parent
7c228ff673
commit
b2221f7b19
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue