Module: BootstrapPager::ConfigurationMethods::ClassMethods

Included in:
DataMapperExtension::Model, PaginatableArray, PluckyCriteriaMethods
Defined in:
lib/bootstrap_pager/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/bootstrap_pager/models/configuration_methods.rb', line 15

def default_per_page
  (defined?(@_default_per_page) && @_default_per_page) || BootstrapPager.config.default_per_page
end

#max_pagesObject

This model's max_pages value returns max_pages value unless explicitly overridden via max_pages_per


43
44
45
# File 'lib/bootstrap_pager/models/configuration_methods.rb', line 43

def max_pages
  (defined?(@_max_pages) && @_max_pages) || BootstrapPager.config.max_pages
end

#max_pages_per(val) ⇒ Object

Overrides the max_pages value per model

class Article < ActiveRecord::Base
  max_pages_per 100
end

37
38
39
# File 'lib/bootstrap_pager/models/configuration_methods.rb', line 37

def max_pages_per(val)
  @_max_pages = val
end

#max_paginates_per(val) ⇒ Object

Overrides the max per_page value per model

class Article < ActiveRecord::Base
  max_paginates_per 100
end

23
24
25
# File 'lib/bootstrap_pager/models/configuration_methods.rb', line 23

def max_paginates_per(val)
  @_max_per_page = val
end

#max_per_pageObject

This model's max per_page value returns max_per_page value unless explicitly overridden via max_paginates_per


29
30
31
# File 'lib/bootstrap_pager/models/configuration_methods.rb', line 29

def max_per_page
  (defined?(@_max_per_page) && @_max_per_page) || BootstrapPager.config.max_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/bootstrap_pager/models/configuration_methods.rb', line 9

def paginates_per(val)
  @_default_per_page = val
end