Skip to content

WillFilter breaks after calls to ActiveRecord::Relation#page in apps using will_paginate #55

@plerohellec

Description

@plerohellec

Kaminari adds the page method to ActiveRecord::Relation. Kaminari actually makes this method name configurable but WillFilter uses the 'page' method name and doesn't support a configuration option to change it. As a result, in applications using will_paginate, WillFilter::Filter#results blows up:

    def results
      @results ||= begin
        ...

        if custom_conditions?
          recs = process_custom_conditions(recs.all)
          recs = Kaminari.paginate_array(recs)
        end  

        recs = recs.page(page).per(per_page)
        recs.wf_filter = self
        recs
      end
    end

on the call to "per" as the will_paginate page method will have been called instead of the Kaminari one.

WillFilter should make the method name configurable the same way Kaminari daes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions