Sha256: 73a8bb13b33dcbc832ae46caa56b7cffdac15ce1d8b9c0bd8433ae6cc67d64ac

Contents?: true

Size: 423 Bytes

Versions: 8

Compression:

Stored size: 423 Bytes

Contents

require 'active_support/concern'

module Brightcontent
  module Pagination
    extend ActiveSupport::Concern

    module ClassMethods
      def per_page(number)
        @per_page_count = number
      end

      def per_page_count
        @per_page_count || 30
      end
    end

    private

    def end_of_association_chain
      super.paginate(page: params[:page], per_page: self.class.per_page_count)
    end

  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
brightcontent-core-2.0.2 lib/brightcontent/pagination.rb
brightcontent-core-2.0.1 lib/brightcontent/pagination.rb
brightcontent-core-2.0.0.alpha6 lib/brightcontent/pagination.rb
brightcontent-core-2.0.0.alpha5 lib/brightcontent/pagination.rb
brightcontent-2.0.0.alpha3 core/lib/brightcontent/pagination.rb
brightcontent-core-2.0.0.alpha3 lib/brightcontent/pagination.rb
brightcontent-2.0.0.alpha2 core/lib/brightcontent/pagination.rb
brightcontent-core-2.0.0.alpha2 lib/brightcontent/pagination.rb