Sha256: 1f01b97c80e1cc4f027b4187a8e4404c0a32cac9970d989444c8d831318c6fc6

Contents?: true

Size: 493 Bytes

Versions: 24

Compression:

Stored size: 493 Bytes

Contents

require 'active_support/concern'

module Brightcontent
  module Pagination
    extend ActiveSupport::Concern

    module ClassMethods
      def per_page_count
        @per_page_count ||= 30
      end

      def per_page(number)
        @per_page_count = number
      end
    end

    private

    def end_of_association_chain
      if action_name == "index"
        super.paginate(page: params[:page], per_page: self.class.per_page_count)
      else
        super
      end
    end

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
brightcontent-core-2.0.27 lib/brightcontent/pagination.rb
brightcontent-core-2.0.26 lib/brightcontent/pagination.rb
brightcontent-core-2.0.25 lib/brightcontent/pagination.rb
brightcontent-core-2.0.24 lib/brightcontent/pagination.rb
brightcontent-core-2.0.23 lib/brightcontent/pagination.rb
brightcontent-core-2.0.22 lib/brightcontent/pagination.rb
brightcontent-core-2.0.21 lib/brightcontent/pagination.rb
brightcontent-core-2.0.20 lib/brightcontent/pagination.rb
brightcontent-core-2.0.19 lib/brightcontent/pagination.rb
brightcontent-core-2.0.18 lib/brightcontent/pagination.rb
brightcontent-core-2.0.17 lib/brightcontent/pagination.rb
brightcontent-core-2.0.16 lib/brightcontent/pagination.rb
brightcontent-core-2.0.15 lib/brightcontent/pagination.rb
brightcontent-core-2.0.14 lib/brightcontent/pagination.rb
brightcontent-core-2.0.13 lib/brightcontent/pagination.rb
brightcontent-core-2.0.12 lib/brightcontent/pagination.rb
brightcontent-core-2.0.11 lib/brightcontent/pagination.rb
brightcontent-core-2.0.10 lib/brightcontent/pagination.rb
brightcontent-core-2.0.9 lib/brightcontent/pagination.rb
brightcontent-core-2.0.8 lib/brightcontent/pagination.rb