From 2e5dedd533338eb7eab1e1e47984d67b2ecae127 Mon Sep 17 00:00:00 2001 From: Andrey Koleshko Date: Mon, 3 Oct 2016 11:39:15 +0300 Subject: [PATCH] Don't lose source location of the pagination method --- lib/kaminari/models/active_record_model_extension.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kaminari/models/active_record_model_extension.rb b/lib/kaminari/models/active_record_model_extension.rb index 53333da..ed16691 100644 --- a/lib/kaminari/models/active_record_model_extension.rb +++ b/lib/kaminari/models/active_record_model_extension.rb @@ -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