Skip to content

Rails 5.0.1 > undefined method 'wf_filter=' #64

@prathees

Description

@prathees

I am getting the below error when using will_filter in Rails 5.0.1

> MyModel.filter params:p
undefined method `wf_filter=' for #<MyModel::ActiveRecord_Relation:0x007fb1f9ec8580>

The error trace shows the following snippet @ app/models/will_filter/filter.rb

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

PS: Skipping this assignment 'recs.wf_filter = self' can solve the problem, but if the project uses the view components from this gem, there could be some breakage.
(refer: results.add_filter_condition @ app/views/will_filter/common/_results_table.html.erb)

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