module Yaqb::QueryBuilders::Paginators::WillPaginateHelper

Private Instance Methods

default_per_page() click to toggle source
# File lib/yaqb/query_builders/paginators/will_paginate_helper.rb, line 38
def default_per_page
  WillPaginate.per_page
end
pages() click to toggle source
# File lib/yaqb/query_builders/paginators/will_paginate_helper.rb, line 29
def pages
  @pages ||= {}.tap do |h|
    h[:first] = 1 if show_first_link?
    h[:prev] = @scope.current_page - 1 if show_previous_link?
    h[:next] = @scope.current_page + 1 if show_next_link?
    h[:last] = @scope.total_pages if show_last_link?
  end
end
paginate!(scope) click to toggle source
# File lib/yaqb/query_builders/paginators/will_paginate_helper.rb, line 9
def paginate!(scope)
  scope.paginate(page: @page, per_page: @per)
end