aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/change_table_test.rb
diff options
context:
space:
mode:
authorAndrey Novikov <envek@envek.name>2014-07-19 23:38:38 +0400
committerAndrey Novikov <envek@envek.name>2014-07-22 15:21:11 +0400
commit6d327dbc0cd7969375e14a56c0a9bc6a7c847056 (patch)
treef4d231d0918336f1b5b5afa4e7d7ee83bc3f4db2 /activerecord/test/cases/migration/change_table_test.rb
parentbb3b2d0b092af3c311ca06c5481b45ee6ee1b5b1 (diff)
downloadrails-6d327dbc0cd7969375e14a56c0a9bc6a7c847056.tar.gz
rails-6d327dbc0cd7969375e14a56c0a9bc6a7c847056.tar.bz2
rails-6d327dbc0cd7969375e14a56c0a9bc6a7c847056.zip
Allow to specify a type for foreign key column in migrations
[Andrey Novikov & Ɓukasz Sarnacki]
Diffstat (limited to 'activerecord/test/cases/migration/change_table_test.rb')
-rw-r--r--activerecord/test/cases/migration/change_table_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration/change_table_test.rb b/activerecord/test/cases/migration/change_table_test.rb
index a6d506b04a..3e9d957ed3 100644
--- a/activerecord/test/cases/migration/change_table_test.rb
+++ b/activerecord/test/cases/migration/change_table_test.rb
@@ -72,6 +72,20 @@ module ActiveRecord
end
end
+ def test_references_column_type_with_polymorphic_and_type
+ with_change_table do |t|
+ @connection.expect :add_reference, nil, [:delete_me, :taggable, polymorphic: true, type: :string]
+ t.references :taggable, polymorphic: true, type: :string
+ end
+ end
+
+ def test_remove_references_column_type_with_polymorphic_and_type
+ with_change_table do |t|
+ @connection.expect :remove_reference, nil, [:delete_me, :taggable, polymorphic: true, type: :string]
+ t.remove_references :taggable, polymorphic: true, type: :string
+ end
+ end
+
def test_timestamps_creates_updated_at_and_created_at
with_change_table do |t|
@connection.expect :add_timestamps, nil, [:delete_me]