API de comptabilité horaire.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

paginated.rb 267B

12345678910111213
  1. module Paginated
  2. DEFAULT_COUNT_BY_PAGE = 10
  3. # can be overwritten
  4. def count_by_page
  5. DEFAULT_COUNT_BY_PAGE
  6. end
  7. def paginate(params)
  8. page = (params.fetch :page, 0).to_i
  9. start = page * count_by_page
  10. offset(start).limit(count_by_page)
  11. end
  12. end