7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/esse/will_paginate/pagination.rb', line 7
def self.included(base)
base.class_eval " # Define the `paginate` WillPaginate method\n #\n # @param [Hash] options\n # @option options [Integer] :page\n # @option options [Integer] :per_page\n # @return [Esse::WillPaginate::SearchQuery]\n def paginate(options = {})\n curr_page = ::WillPaginate::PageNumber(options[:page] || 1)\n limit_val = (options[:per_page] || ::WillPaginate.per_page).to_i\n offset_val = (curr_page - 1) * limit_val\n limit(limit_val).offset(offset_val)\n end\n RUBY\nend\n", __FILE__, __LINE__ + 1
|