Module: Kaminari::ConfigurationMethods::ClassMethods

Included in:
PaginatableArray
Defined in:
lib/kaminari/models/configuration_methods.rb

Instance Method Summary collapse

Instance Method Details

#default_per_pageObject

This model’s default per_page value returns default_per_page value unless explicitly overridden via paginates_per



15
16
17
# File 'lib/kaminari/models/configuration_methods.rb', line 15

def default_per_page
  @_default_per_page || Kaminari.config.default_per_page
end

#paginates_per(val) ⇒ Object

Overrides the default per_page value per model

class Article < ActiveRecord::Base
  paginates_per 10
end


9
10
11
# File 'lib/kaminari/models/configuration_methods.rb', line 9

def paginates_per(val)
  @_default_per_page = val
end