Module: Folio::WillPaginate::ActiveRecord::Pagination

Includes:
Ordinal
Defined in:
lib/folio/will_paginate/active_record.rb

Defined Under Namespace

Classes: PageProxy

Constant Summary

Constants included from Folio

VERSION

Instance Method Summary collapse

Methods included from Ordinal

#configure_pagination

Methods included from Folio

#configure_pagination, #paginate

Methods included from PerPageIncluder

#included

Methods included from PerPage

#per_page

Instance Method Details

#build_pageObject

set up the proxy to receive the calls



95
96
97
# File 'lib/folio/will_paginate/active_record.rb', line 95

def build_page
  PageProxy.new(self)
end

#default_per_pageObject

don’t try and look at Class (ActiveRecord::Base.class, etc.) for defaults



111
112
113
# File 'lib/folio/will_paginate/active_record.rb', line 111

def default_per_page
  Folio.per_page
end

#fill_page(proxy) ⇒ Object

pull the result out of the proxy



100
101
102
# File 'lib/folio/will_paginate/active_record.rb', line 100

def fill_page(proxy)
  proxy.result
end

#page(num) ⇒ Object

make sure the relation coming out of page(…) is folio-compatible



105
106
107
# File 'lib/folio/will_paginate/active_record.rb', line 105

def page(num)
  super.extending(RelationMethods)
end