From ebfd03b938d2cb996bc5786768e339b7221a724d Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Fri, 11 Jan 2008 19:54:19 +0000 Subject: Fix issue where Table#references doesn't pass a :null option to a *_type attribute for polymorphic associations. Closes #10753 [railsjitsu] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8627 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/migration_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/migration_test.rb b/activerecord/test/migration_test.rb index 3b74604c44..f2683f3aef 100644 --- a/activerecord/test/migration_test.rb +++ b/activerecord/test/migration_test.rb @@ -925,6 +925,14 @@ if ActiveRecord::Base.connection.supports_migrations? end end + def test_references_column_type_with_polymorphic_and_options_null_is_false_adds_table_flag + with_new_table do |t| + t.expects(:column).with('taggable_type', :string, {:null => false}) + t.expects(:column).with('taggable_id', :integer, {:null => false}) + t.references :taggable, :polymorphic => true, :null => false + end + end + def test_belongs_to_works_like_references with_new_table do |t| t.expects(:column).with('customer_id', :integer, {}) -- cgit v1.2.3