Joined June 2014
·
Posted to
Scopes with Ransack
over 1 year
ago
It seems to be a pretty nice solution for adding scopes to Ransack. I think its an elegant solution to that problem.
However I am wondering why you pass Order.all to the siphon method at this line:
@orders = siphon(Order.all).scope(@order_form)
When you call Order.all is it going execute the query ? How can you apply the scope on the array?
Should it be instead, something like this ?:
@orders = siphon(Order.scoped).scope(@order_form)
Achievements
58 Karma
0 Total ProTip Views
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
Forked
Have a project valued enough to be forked by someone else
Charity
Fork and commit to someone's open source project in need
Mongoose 3
Have at least three original repos where Ruby is the dominant language
Mongoose
Have at least one original repo where Ruby is the dominant language
Beaver
Have at least one original repo where go is the dominant language
Thanks for the quick response, I didn't know about that Rails 4 change.
Thanks again for your gem it helped me a lot for migrating from a Rails 2 with searchlogic to a Rails 3 with Ransack.