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:
parent
90e749afd0
commit
a5ebc7cc89
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue