Unify boolean quoting for Mysql- and Mysql2Adapter. - #12425
Conversation
|
Why is this not merged already??? Please, merge it so it can be added to v4.0.1... it's a broken functionality! |
|
Even if we merge this one right now, it won't be part of |
|
Bummer! |
|
@iwiznia we are aware of that, that's where the issue originated from. (If you want to read back on the discussion, see the issues I linked at the top). |
|
@iwiznia I've never understood why people are putting |
|
Well it's only useful when using it with the scope option too. |
Surely the better way to model this would be a |
|
Well, it depends on the use case, the case I described is a small example... |
|
The reason to use an attribute on the user model is one of atomicity - with the validation on the |
|
Yes, you need to update the previous active to false first, but that's no problem... In the other solution, you also have 2 make 2 operations, first create the record, then associate it in the parent model, so it's basically the same. |
|
@pixeltrix: by setting I'm also hitting this problem and I can't add another column because in my case, a tag can have many names, with each |
Unify boolean quoting for Mysql- and Mysql2Adapter.
|
Can we backport this to 4-0-stable? @carlosantoniodasilva @senny |
|
@arthurnn better not. This actually changes behavior. I hope no-one is actively relying on the old one but better save than sorry. |
|
I'm finally getting around to upgrading a rails 3.2 app to rails 4 and use the uniqueness validation on a boolean field with a scope and this issue breaks it as already mentioned. What I don't see is a suggested fix for this regression. What are people currently doing to get this working again with rails 4? |
|
@akaspick we use this monkey patch: https://gist.github.com/byroot/9645116 |
|
@byroot Thanks. Works perfectly. |
This issue was raised with #11119. Fixed with #11120 and later reverted to prevent possible backward incompatible changes.
Since then I've written a bunch of test-cases to illustrate the behavior of
Mysql2Adapters quoting and to reason about consequences of the patch.