aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2017-03-04 11:06:43 +0000
committerGitHub <noreply@github.com>2017-03-04 11:06:43 +0000
commitd341a47fcc74be74b16798c62e95021fc2893ba4 (patch)
tree5df794c6512b64bf5ad8fb7652d812a376d82a41 /activerecord/test/cases/migration
parentb5dc1f6dea1fec088c6af46eba9b675bfb64a72a (diff)
parent465357aecfcfd5ae0b1f95b8a848e38ac868999d (diff)
downloadrails-d341a47fcc74be74b16798c62e95021fc2893ba4.tar.gz
rails-d341a47fcc74be74b16798c62e95021fc2893ba4.tar.bz2
rails-d341a47fcc74be74b16798c62e95021fc2893ba4.zip
Merge pull request #28282 from kamipo/dont_share_options_with_with_reference_type_column
Don't share `options` with a reference type column
Diffstat (limited to 'activerecord/test/cases/migration')
-rw-r--r--activerecord/test/cases/migration/references_statements_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration/references_statements_test.rb b/activerecord/test/cases/migration/references_statements_test.rb
index df15d7cb45..06c44c8c52 100644
--- a/activerecord/test/cases/migration/references_statements_test.rb
+++ b/activerecord/test/cases/migration/references_statements_test.rb
@@ -50,6 +50,13 @@ module ActiveRecord
assert column_exists?(table_name, :taggable_type, :string, default: "Photo")
end
+ def test_does_not_share_options_with_reference_type_column
+ add_reference table_name, :taggable, type: :integer, limit: 2, polymorphic: true
+ assert column_exists?(table_name, :taggable_id, :integer, limit: 2)
+ assert column_exists?(table_name, :taggable_type, :string)
+ assert_not column_exists?(table_name, :taggable_type, :string, limit: 2)
+ end
+
def test_creates_named_index
add_reference table_name, :tag, index: { name: "index_taggings_on_tag_id" }
assert index_exists?(table_name, :tag_id, name: "index_taggings_on_tag_id")