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
Instance Method Summary collapse
-
#build_page ⇒ Object
set up the proxy to receive the calls.
-
#default_per_page ⇒ Object
don’t try and look at Class (ActiveRecord::Base.class, etc.) for defaults.
-
#fill_page(proxy) ⇒ Object
pull the result out of the proxy.
-
#page(num) ⇒ Object
make sure the relation coming out of page(…) is folio-compatible.
Methods included from Ordinal
Methods included from Folio
#configure_pagination, #paginate
Methods included from PerPageIncluder
Methods included from PerPage
Instance Method Details
#build_page ⇒ Object
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_page ⇒ Object
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 |