diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-05 02:46:28 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-05 02:46:28 +0000 |
commit | e7dab3b1662da88542d5659e7eb5bbe515e7e1b5 (patch) | |
tree | b55a3da09e9ffc33c337439c336a6cc23a207a7f /activerecord/test | |
parent | 3a622d0045771459e6d4cc32307f31f87e5b938a (diff) | |
download | rails-e7dab3b1662da88542d5659e7eb5bbe515e7e1b5.tar.gz rails-e7dab3b1662da88542d5659e7eb5bbe515e7e1b5.tar.bz2 rails-e7dab3b1662da88542d5659e7eb5bbe515e7e1b5.zip |
MySQL: we can't distinguish a fake 0 default in 4.x
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/defaults_test.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/test/defaults_test.rb b/activerecord/test/defaults_test.rb index 965dd956b0..9701d1a8af 100644 --- a/activerecord/test/defaults_test.rb +++ b/activerecord/test/defaults_test.rb @@ -31,7 +31,8 @@ class DefaultTest < Test::Unit::TestCase assert_equal 0, klass.columns_hash['zero'].default assert !klass.columns_hash['zero'].null - assert_equal nil, klass.columns_hash['omit'].default + # 0 in MySQL 4, nil in 5. + assert [0, nil].include?(klass.columns_hash['omit'].default) assert !klass.columns_hash['omit'].null assert_raise(ActiveRecord::StatementInvalid) { klass.create! } |