Sha256: b1d8bc9e46c387c36f65c2be47f42624ca98433b6923d53c0f1b842acf369435
Contents?: true
Size: 1.01 KB
Versions: 2
Compression:
Stored size: 1.01 KB
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 +default_per_page+ value unless explicitly overridden via <tt>paginates_per</tt> def default_per_page @_default_per_page ||= Kaminari.config.default_per_page end # Overrides the max +per_page+ value per model # class Article < ActiveRecord::Base # max_paginates_per 100 # end def max_paginates_per(val) @_max_per_page = val end # This model's max +per_page+ value # returns +max_per_page+ value unless explicitly overridden via <tt>max_paginates_per</tt> def max_per_page @_max_per_page || Kaminari.config.max_per_page end end end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
sunrise-cms-0.5.0.rc1 | vendor/bundle/ruby/1.9.1/gems/kaminari-0.14.1/lib/kaminari/models/configuration_methods.rb |
kaminari-0.14.1 | lib/kaminari/models/configuration_methods.rb |