Don't lose source location of the pagination method
This commit is contained in:
parent
be3a2c9a21
commit
509c945342
|
@ -9,7 +9,7 @@ module Kaminari
|
||||||
|
|
||||||
# Fetch the values at the specified page number
|
# Fetch the values at the specified page number
|
||||||
# Model.page(5)
|
# Model.page(5)
|
||||||
eval <<-RUBY
|
eval <<-RUBY, nil, __FILE__, __LINE__ + 1
|
||||||
def self.#{Kaminari.config.page_method_name}(num = nil)
|
def self.#{Kaminari.config.page_method_name}(num = nil)
|
||||||
limit(default_per_page).offset(default_per_page * ((num = num.to_i - 1) < 0 ? 0 : num)).extending do
|
limit(default_per_page).offset(default_per_page * ((num = num.to_i - 1) < 0 ? 0 : num)).extending do
|
||||||
include Kaminari::ActiveRecordRelationMethods
|
include Kaminari::ActiveRecordRelationMethods
|
||||||
|
|
Loading…
Reference in New Issue