Sha256: ed86a6169d3f855e9491ec29da86804e4b3434021ca55cf0e1605f710e1dade3

Contents?: true

Size: 378 Bytes

Versions: 38

Compression:

Stored size: 378 Bytes

Contents

module Controller
  module PaginationConcern
    extend ActiveSupport::Concern

    private

    def load_collection
      collection_scope.page(params[:page]).per(pagination_size)
    end

    def pagination_size
      return collection_scope.count if params[:per_page] == 'all'
      params[:per_page] || Itsf::Backend::Configuration.default_pagination_size
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
itsf_backend-3.1.1 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-3.1.0 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-3.0.7 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-3.0.6 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-3.0.5 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-3.0.4 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-3.0.3 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-3.0.2 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-3.0.1 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-3.0.0 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-2.2.1 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-2.2.0 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-2.1.0 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-2.0.2 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-2.0.1 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-1.2.8 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-1.2.7 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-1.2.6 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-1.2.5 app/controllers/concerns/controller/pagination_concern.rb
itsf_backend-1.2.4 app/controllers/concerns/controller/pagination_concern.rb