Created
March 19, 2014 16:08
-
-
Save byroot/9645116 to your computer and use it in GitHub Desktop.
Monkey patch for https://github.com/rails/rails/pull/12425#issuecomment-38069331
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if Rails::VERSION::MAJOR >= 4 | |
if Rails::VERSION::MINOR > 0 | |
ActiveSupport::Deprecation.warn("This patch is probably not useful anymore. Check if https://github.com/rails/rails/pull/12425 have been released.") | |
end | |
class ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter | |
def type_cast(value, column) | |
case value | |
when TrueClass | |
1 | |
when FalseClass | |
0 | |
else | |
super | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment