Fixed that MySQL enums should always be returned as strings (closes #3501) [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4028 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2006-03-25 21:42:27 +00:00
parent 4b66180cca
commit 75de3cbb13
2 changed files with 3 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
*SVN*
* Fixed that MySQL enums should always be returned as strings #3501 [DHH]
* Change has_many :through to use the :source option to specify the source association. :class_name is now ignored. [Rick Olson]
class Connection < ActiveRecord::Base

View File

@@ -43,6 +43,7 @@ module ActiveRecord
private
def simplified_type(field_type)
return :boolean if MysqlAdapter.emulate_booleans && field_type.downcase.index("tinyint(1)")
return :string if field_type =~ /enum/i
super
end
end