Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 5.0.1 > undefined method 'wf_filter=' #64

Open
prathees opened this issue Jan 6, 2017 · 1 comment
Open

Rails 5.0.1 > undefined method 'wf_filter=' #64

prathees opened this issue Jan 6, 2017 · 1 comment

Comments

@prathees
Copy link

prathees commented Jan 6, 2017

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)

prathees pushed a commit to prathees/will_filter that referenced this issue Jan 9, 2017
Refer : berk#64

Adding the wf_filter and related methods to ActiveRecord::Relation via extensions
@prathees
Copy link
Author

prathees commented Jan 9, 2017

Fixed this in my forked branch : https://github.com/prathees/will_filter
by adding the 'wf_filter' related methods to ActiveRecord::Relation via extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant