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

Tweak @options before use

This commit is contained in:
Akira Matsuda 2013-11-24 00:39:31 +09:00
parent 90e749afd0
commit a5ebc7cc89

View file

@ -12,6 +12,10 @@ module Kaminari
include ::ActionView::Context
def initialize(template, options) #:nodoc:
#FIXME for compatibility. remove num_pages at some time in the future
options[:total_pages] ||= options[:num_pages]
options[:num_pages] ||= options[:total_pages]
@window_options = {}.tap do |h|
h[:window] = options.delete(:window) || options.delete(:inner_window) || Kaminari.config.window
outer_window = options.delete(:outer_window) || Kaminari.config.outer_window
@ -23,9 +27,6 @@ module Kaminari
@template, @options = template, options
@theme = @options[:theme] ? "#{@options[:theme]}/" : ''
@options[:current_page] = PageProxy.new @window_options.merge(@options), @options[:current_page], nil
#FIXME for compatibility. remove num_pages at some time in the future
@options[:total_pages] ||= @options[:num_pages]
@options[:num_pages] ||= @options[:total_pages]
@last = nil
# initialize the output_buffer for Context
@output_buffer = ActionView::OutputBuffer.new