From bd8fabafe763ec5f46d6a4c0e000214f684a901a Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Thu, 8 Dec 2016 16:25:08 +0900 Subject: [PATCH] :golf: --- kaminari-core/lib/kaminari/helpers/helper_methods.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kaminari-core/lib/kaminari/helpers/helper_methods.rb b/kaminari-core/lib/kaminari/helpers/helper_methods.rb index a599297..3b13d35 100644 --- a/kaminari-core/lib/kaminari/helpers/helper_methods.rb +++ b/kaminari-core/lib/kaminari/helpers/helper_methods.rb @@ -106,9 +106,7 @@ module Kaminari if collection.total_pages < 2 t('helpers.page_entries_info.one_page.display_entries', entry_name: entry_name, count: collection.total_count) else - first = collection.offset_value + 1 - last = (sum = collection.offset_value + collection.limit_value) > collection.total_count ? collection.total_count : sum - t('helpers.page_entries_info.more_pages.display_entries', entry_name: entry_name, first: first, last: last, total: collection.total_count) + t('helpers.page_entries_info.more_pages.display_entries', entry_name: entry_name, first: collection.offset_value + 1, last: [collection.offset_value + collection.limit_value, collection.total_count].min, total: collection.total_count) end.html_safe end