-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Issue #1099: Filtering on "Is present" and "Is blank" on boolean columns #2675
Issue #1099: Filtering on "Is present" and "Is blank" on boolean columns #2675
Conversation
CI failing due to Rubocop issues addressed in PR 2679 |
Filtering a boolean field on "Is present" or "Is blank" produces SQL that includes checking against an empty string. Since a boolean field can only be true, false, or null, this causes errors in some databases. This commit removes the empty string search for boolean field types.
c658799
to
7178349
Compare
Test needed! |
Come on! The original code isn't tested... how about you test the existing functionality and I'll test the micro-change in this PR and keep using my fork in the mean-time? :P |
The original code is tested here, |
7178349
to
3e78509
Compare
I've updated those tests but that is both nasty and terribly smelly. The fact that changing the code didn't cause a test to break tells you it wasn't properly tested. There is no testing for the class itself, just the output after running through a module and two classes. If you are lucky enough for a future change to break the test, there will still be some analysis to work out where the issue exists. Even having 2 classes nested inside that module with module methods and classes mixed together is horrible and it makes it harder to find what you are looking for. |
I clearly state that horrible tests are better than no tests at all. Thank you for your work, I really appreciate it 😃 |
Filtering a boolean field on "Is present" or "Is blank" produces SQL that
includes checking against an empty string. Since a boolean field can only be
true, false, or null, this causes errors in some databases.
Remove the empty string search for boolean field types.