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

Reduce Hash creation

This commit is contained in:
Akira Matsuda 2013-11-24 01:04:11 +09:00
parent a5ebc7cc89
commit 8902c44b36

View file

@ -26,7 +26,9 @@ module Kaminari
end
@template, @options = template, options
@theme = @options[:theme] ? "#{@options[:theme]}/" : ''
@options[:current_page] = PageProxy.new @window_options.merge(@options), @options[:current_page], nil
@window_options.merge! @options
@window_options[:current_page] = @options[:current_page] = PageProxy.new @window_options, @options[:current_page], nil
@last = nil
# initialize the output_buffer for Context
@output_buffer = ActionView::OutputBuffer.new
@ -47,8 +49,8 @@ module Kaminari
def each_relevant_page
return to_enum(:each_relevant_page) unless block_given?
relevant_pages(@window_options.merge(@options)).each do |i|
yield PageProxy.new(@window_options.merge(@options), i, @last)
relevant_pages(@window_options).each do |i|
yield PageProxy.new(@window_options, i, @last)
end
end
alias each_page each_relevant_page
@ -95,12 +97,12 @@ module Kaminari
end
subscriber.render_without_logging = true
ret = super @window_options.merge(@options).merge :paginator => self
ret = super @window_options.merge :paginator => self
subscriber.render_without_logging = false
ret
else
super @window_options.merge(@options).merge :paginator => self
super @window_options.merge :paginator => self
end
end