Fix filter by scope on search page #12036
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎩 What? Why?
Fix the error raised when filtering by scope on the search page. The scope filter has been removed on the redesign, that's why this PR targets the
release/0.27-stable
branch instead ofdevelop
.This error raises because we are using the ransack
_eq
filter instead of the_in
using an array as input. In the front end, we use thescopes_picker_filter
helper to render the scope multi-picker, and it produces an array argument instead of a single value. That's why I have changed the ransack filter in this PR.IMO, we should remove the references to the scope filter in the search controller and command in the
develop
branch, as we are no longer using it since the redesign was merged.📌 Related Issues
Testing
📷 Screenshots
Screen.Recording.2023-11-20.at.12.29.00.mov