diff options
author | Jamis Buck <jamis@37signals.com> | 2006-03-17 22:03:26 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2006-03-17 22:03:26 +0000 |
commit | d712310518dcfe42966e7de936794c9a816b0e21 (patch) | |
tree | 99bfbb3a8af33beda330c4e45f3f70eb35a6b095 | |
parent | 795c71f2ee60f53e8b9a6b964700c0245d8ec5f1 (diff) | |
download | rails-d712310518dcfe42966e7de936794c9a816b0e21.tar.gz rails-d712310518dcfe42966e7de936794c9a816b0e21.tar.bz2 rails-d712310518dcfe42966e7de936794c9a816b0e21.zip |
Make all tinyint(1) variants act like boolean in mysql (tinyint(1) unsigned, etc.)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3902 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index b02626f4aa..beb8d8084b 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Make all tinyint(1) variants act like boolean in mysql (tinyint(1) unsigned, etc.) [Jamis Buck] + * Use association's :conditions when eager loading. [jeremyevans0@gmail.com] #4144 * Alias the has_and_belongs_to_many join table on eager includes. #4106 [jeremyevans0@gmail.com] diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index e0d1ac3b54..842126a991 100755 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -42,7 +42,7 @@ module ActiveRecord class MysqlColumn < Column #:nodoc: private def simplified_type(field_type) - return :boolean if MysqlAdapter.emulate_booleans && field_type.downcase == "tinyint(1)" + return :boolean if MysqlAdapter.emulate_booleans && field_type.downcase.index("tinyint(1)") super end end |