aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-03-25 21:42:27 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-03-25 21:42:27 +0000
commit75de3cbb13b03da8d53460de2a33135269a0a379 (patch)
treee8f9622519144d6582e497e5332b6a31e4e31dd5
parent4b66180ccad53940b18ca1a4350159b1fcf2695c (diff)
downloadrails-75de3cbb13b03da8d53460de2a33135269a0a379.tar.gz
rails-75de3cbb13b03da8d53460de2a33135269a0a379.tar.bz2
rails-75de3cbb13b03da8d53460de2a33135269a0a379.zip
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
-rw-r--r--activerecord/CHANGELOG2
-rwxr-xr-xactiverecord/lib/active_record/connection_adapters/mysql_adapter.rb1
2 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index afceb51180..52c2e81fb1 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -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
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
index 9e06c63181..881e22c476 100755
--- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -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