-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
Add tests of how boolean columns worked in 1.6.3 #507
Add tests of how boolean columns worked in 1.6.3 #507
Conversation
ca6bc81
to
cbd65b4
Compare
Hmm looks like mysql uses a |
Maybe the test could switch on Or we could drop the right-hand side of the SQL comparison in our test assertion. Just testing the presence of the column would be an improvement over |
cbd65b4
to
0534d09
Compare
The string '1', in 1.6.3, was translated into boolean true. These tests pass in 1.6.3 and fail after 9f4e48e.
0534d09
to
4219fdf
Compare
Suggest: |
OK, just saw this, thanks 👍 My initial thought is to prefer adding these tests in the |
These tests are meant to prevent changing the TRUE_VALUES and FALSE_VALUES sets in RANSACK::CONSTANTS without a very good reason. Previously, no test was alerting us against merging changes like #503.
Nice. Thanks! Is there a quoting method for |
Yes: def expected_boolean_eq_query(boolean_value)
field = "#{quote_table_name("people")}.#{quote_column_name("awesome")}"
condition = ActiveRecord::Base.connection.quote(boolean_value)
/#{field} = #{condition}/
end |
Cool, I'll give |
Thanks guys! :) |
Thanks to both of you for the heads up! 💚 |
Makes sense, especially the "test for all the values" part. My tests here only cover char '0' and '1'. Thanks! |
The string '1', in 1.6.3, was translated into boolean true.
These tests pass in 1.6.3 and fail after 9f4e48e.
CC: #503