Skip to content
Browse files

Make all tinyint(1) variants act like boolean in mysql (tinyint(1) un…

…signed, etc.)

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3902 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 795c71f commit d712310518dcfe42966e7de936794c9a816b0e21 @jamis jamis committed Mar 17, 2006
Showing with 3 additions and 1 deletion.
  1. +2 −0 activerecord/CHANGELOG
  2. +1 −1 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
View
2 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]
View
2 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -42,7 +42,7 @@ module ConnectionAdapters
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

0 comments on commit d712310

Please sign in to comment.
Something went wrong with that request. Please try again.