Sha256: bd7c2d333b2fdf5e49e58b443c7813b79ae31cd0502ccaa0a1f4909bbcb0fabf

Contents?: true

Size: 363 Bytes

Versions: 4

Compression:

Stored size: 363 Bytes

Contents

module Upmin
  module Paginator

    def Paginator.paginate(chain, page = 1, per_page = 30)
      if defined?(WillPaginate)
        # Ignore per page for now - just use the will_paginate default
        return chain.paginate(page: page.to_i, per_page: per_page)
      else # Use Kaminari
        return chain.page(page).per(per_page)
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
upmin-admin-0.1.3 lib/upmin/paginator.rb
upmin-admin-0.1.01 lib/upmin/paginator.rb
upmin-admin-0.1.0 lib/upmin/paginator.rb
upmin-admin-0.0.39 lib/upmin/paginator.rb