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 paginates_per def default_per_page @_default_per_page || Kaminari::DEFAULT_PER_PAGE end end end end