From 2e73123c583c70d8621650c74e64253a414ceb83 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Sat, 23 Apr 2022 07:46:44 +0900 Subject: [PATCH] Reduce ivar --- kaminari-core/lib/kaminari/helpers/paginator.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kaminari-core/lib/kaminari/helpers/paginator.rb b/kaminari-core/lib/kaminari/helpers/paginator.rb index 9eedd9a..2891947 100644 --- a/kaminari-core/lib/kaminari/helpers/paginator.rb +++ b/kaminari-core/lib/kaminari/helpers/paginator.rb @@ -88,12 +88,13 @@ module Kaminari include Comparable def initialize(options, page, last) #:nodoc: - @options, @page, @last = options, page, last + @options, @page = options, page @current_page = @options[:current_page] @total_pages = @options[:total_pages] @left = @options[:left] @right = @options[:right] @window = @options[:window] + @was_truncated = last.is_a? Gap end # the page number @@ -163,7 +164,7 @@ module Kaminari # The last rendered tag was "truncated" or not def was_truncated? - @last.is_a? Gap + @was_truncated end #Should we display the link tag?