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.