aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2012-09-20 15:09:21 +0300
committerSteve Klabnik <steve@steveklabnik.com>2012-11-21 13:21:18 -0600
commit48a035712e9a4478ff248fd51ff43505d2aa2ddb (patch)
tree83156a17d9e7eee23e3fa7e2e5dd69ba7100141d /activerecord/test
parent2068d300917ed95a82e7377ee77b397fc4084a61 (diff)
downloadrails-48a035712e9a4478ff248fd51ff43505d2aa2ddb.tar.gz
rails-48a035712e9a4478ff248fd51ff43505d2aa2ddb.tar.bz2
rails-48a035712e9a4478ff248fd51ff43505d2aa2ddb.zip
Coerce strings in create_join_table.
If you accidentally pass a string and a symbol, this breaks. So we coerce them both to strings. Fixes #7715
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/migration_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index 3c0d2b18d9..78e6387a87 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -759,4 +759,11 @@ class CopyMigrationsTest < ActiveRecord::TestCase
ensure
clear
end
+
+ def test_create_join_table_with_symbol_and_string
+ connection.create_join_table :artists, 'musics'
+
+ assert_equal %w(artist_id music_id), connection.columns(:artists_musics).map(&:name).sort
+ end
+
end