Created
August 10, 2009 02:00
-
-
Save rubymerchant/164981 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | |
index 2812dbb..c1f44b5 100644 | |
--- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | |
+++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | |
@@ -76,7 +76,7 @@ module ActiveRecord | |
module ConnectionAdapters | |
class MysqlColumn < Column #:nodoc: | |
def extract_default(default) | |
- if type == :binary || type == :text | |
+ if sql_type =~ /blob/i || type == :text | |
if default.blank? | |
return null ? nil : '' | |
else | |
@@ -90,7 +90,7 @@ module ActiveRecord | |
end | |
def has_default? | |
- return false if type == :binary || type == :text #mysql forbids defaults on blob and text columns | |
+ return false if sql_type =~ /blob/i || type == :text #mysql forbids defaults on blob and text columns | |
super | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment