From 8e149d5ac5c6f3126074a197d949f2e07ab22855 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Tue, 6 Jun 2017 17:03:23 +0900 Subject: [PATCH] else + ternary => elsif + else --- .../kaminari/activerecord/active_record_relation_methods.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kaminari-activerecord/lib/kaminari/activerecord/active_record_relation_methods.rb b/kaminari-activerecord/lib/kaminari/activerecord/active_record_relation_methods.rb index 4fdd799..7089d91 100644 --- a/kaminari-activerecord/lib/kaminari/activerecord/active_record_relation_methods.rb +++ b/kaminari-activerecord/lib/kaminari/activerecord/active_record_relation_methods.rb @@ -33,8 +33,10 @@ module Kaminari c = c.count(column_name) @total_count = if c.is_a?(Hash) || c.is_a?(ActiveSupport::OrderedHash) c.count - else - c.respond_to?(:count) ? c.count(column_name) : c + elsif c.respond_to? :count + c.count(column_name) + else + c end end