Don't lose source location of the pagination method

This commit is contained in:
Andrey Koleshko 2016-10-03 11:39:15 +03:00
parent be3a2c9a21
commit 509c945342
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ module Kaminari
# Fetch the values at the specified page number
# Model.page(5)
eval <<-RUBY
eval <<-RUBY, nil, __FILE__, __LINE__ + 1
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
include Kaminari::ActiveRecordRelationMethods