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

Fix: Filter badge fields #3071

Closed
wants to merge 2 commits into from
Closed

Conversation

binarygit
Copy link
Contributor

@binarygit binarygit commented Jul 30, 2024

Description

Filtering badge fields did not work because we passed string values of enums into ransack. Ransack does not convert these strings into the appropriate numbers like they are stored in the database which is why filtering badge fields didn't work.

These changes introduce a new option to pass into badge field called enum which let's us pass in appropriate values into ransack when filtering.

Fixes #2822

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Screenshots & recording

Before:

2024-07-30.15-45-31.mp4

After:

2024-07-30.15-46-58.mp4

Manual review steps

  1. Step 1
  2. Step 2

Manual reviewer: please leave a comment with output from the test if that's the case.

Copy link

codeclimate bot commented Jul 30, 2024

Code Climate has analyzed commit f840bd2 and detected 0 issues on this pull request.

View more on Code Climate.

@binarygit binarygit changed the title Fix: filtering badge field not working Fix: Filter badge fields Jul 30, 2024
@binarygit binarygit marked this pull request as draft July 30, 2024 10:29
@binarygit binarygit closed this Jul 30, 2024
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

Successfully merging this pull request may close these issues.

Dynamic filter with enum, doesn't filter data
1 participant