app/logical/pagination_extension.rb
# XXX Hack: in sequential pagination we fetch one more record than we
# need so that we can tell when we're on the first or last page. Here
# we override a rails internal method to discard that extra record. See
# #2044, #3642.
XXX Hack: in sequential pagination we fetch one more record than we
need so that we can tell when we're on the first or last page. Here
we override a rails internal method to discard that extra record.
XXX Hack : in sequential pagination we fetch one more record than we need so that we can tell when we ' re on the first or last page . Here we override a rails internal method to discard that extra record .
def records
    if paginator_mode == :sequential_before
      super.first(records_per_page)
    elsif paginator_mode == :sequential_after
      super.first(records_per_page).reverse
    elsif paginator_mode == :numbered
      super
    end
  end
def records if paginator_mode == :sequential_before super . first ( records_per_page ) elsif paginator_mode == :sequential_after super . first ( records_per_page ) . reverse elsif paginator_mode == :numbered super end end
XXX Hack: in sequential pagination we fetch one more record than we
need so that we can tell when we're on the first or last page.
XXX Hack : in sequential pagination we fetch one more record than we need so that we can tell when we ' re on the first or last page .