diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-08-07 17:59:27 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-11-11 16:15:00 +0100 |
commit | 07ae1e9b5557182f69e5ffbac54b334284abf36f (patch) | |
tree | d160eab55a7f40da7101d5ff1a52eecd744f0b36 /activerecord/lib/active_record/connection_adapters | |
parent | 07790d5832e1822ce7278f05db1fe8394b5eb780 (diff) | |
download | rails-07ae1e9b5557182f69e5ffbac54b334284abf36f.tar.gz rails-07ae1e9b5557182f69e5ffbac54b334284abf36f.tar.bz2 rails-07ae1e9b5557182f69e5ffbac54b334284abf36f.zip |
Unifies mysql and mysql2 casting of booleans.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 6 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 138ab811dc..ee6ca4fb6f 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -206,6 +206,12 @@ module ActiveRecord true end + def type_cast(value, column) + return super unless value == true || value == false + + value ? 1 : 0 + end + # MySQL 4 technically support transaction isolation, but it is affected by a bug # where the transaction level gets persisted for the whole session: # diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index a690404892..7b18b95c44 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -160,12 +160,6 @@ module ActiveRecord # QUOTING ================================================== - def type_cast(value, column) - return super unless value == true || value == false - - value ? 1 : 0 - end - def quote_string(string) #:nodoc: @connection.quote(string) end |