Skip to content

Instantly share code, notes, and snippets.

@byroot
Created March 19, 2014 16:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save byroot/9645116 to your computer and use it in GitHub Desktop.
Save byroot/9645116 to your computer and use it in GitHub Desktop.
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