From 48a035712e9a4478ff248fd51ff43505d2aa2ddb Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Thu, 20 Sep 2012 15:09:21 +0300 Subject: 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 --- activerecord/test/cases/migration_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activerecord/test') 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 -- cgit v1.2.3