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
doesn't work with rails default_scope #56
Comments
same bug and same workaround for me. |
i created a failing spec for this bug here: and plan on attacking the bug itself next. can't quite wrap my mind around it yet though. |
By the way, :order on a default scope can't be overriden by the :order of a named_scope, and Searchlogic is based on named_scopes. So, that's probably an ActiveRecord bug/feature. |
Where did you get that idea? The outermost named_scope clobbers any default scope. Fixed this in my fork: commit http://github.com/tilsammans/searchlogic/commit/c03a3bfd35dae543d3c3a3e258c187e7edd2ad3d will send a pull request to binarylogic |
From this ticket: But I may be misleading 'cause I don't know ActiveRecord plumbing enough for the moment. Hope your patch will resolve it. |
Bug or just fundamental incompatibility w/rails default_scope? If I declare a default_scope on my model, none of the rails_helpers for click-sort column headings will work.
The search object is built up correctly, but rails clobbers it w/the default scope.
I can work around this by declaring default sort criteria in the controller where the search object is created, but the only thing I don't like is how the the default_scope silently kills your searchlogic search.
Any thoughts?
The text was updated successfully, but these errors were encountered: