Sha256: 793475c56eb211fa6a9112a697acac219ecd08f9c6b1958262788ab4e50035c4

Contents?: true

Size: 551 Bytes

Versions: 7

Compression:

Stored size: 551 Bytes

Contents

module Kaminari
  module ConfigurationMethods
    extend ActiveSupport::Concern
    module ClassMethods
      # Overrides the default per_page value per model
      #   class Article < ActiveRecord::Base
      #     paginates_per 10
      #   end
      def paginates_per(val)
        @_default_per_page = val
      end

      # This model's default per_page value
      # returns 25 unless explicitly overridden via <tt>paginates_per</tt>
      def default_per_page
        @_default_per_page || Kaminari::DEFAULT_PER_PAGE
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
kaminari-0.11.0 lib/kaminari/models/configuration_methods.rb
zhanghd_kaminari-0.10.4.1 lib/kaminari/models/configuration_methods.rb
kaminari-0.10.4 lib/kaminari/models/configuration_methods.rb
kaminari-0.10.3 lib/kaminari/models/configuration_methods.rb
kaminari-0.10.2 lib/kaminari/models/configuration_methods.rb
kaminari-0.10.1 lib/kaminari/models/configuration_methods.rb
kaminari-0.10.0 lib/kaminari/models/configuration_methods.rb