Permalink
Browse files

Merge pull request #7716 from steveklabnik/issue_7715

Coerce strings in create_join_table.
  • Loading branch information...
2 parents 0cf3092 + 48a0357 commit b6793ba110c990ca00bab39a047287bd0bd825f1 @rafaelfranca rafaelfranca committed Nov 21, 2012
@@ -8,7 +8,7 @@ def find_join_table_name(table_1, table_2, options = {})
end
def join_table_name(table_1, table_2)
- [table_1, table_2].sort.join("_").to_sym
+ [table_1.to_s, table_2.to_s].sort.join("_").to_sym
end
end
end
@@ -755,4 +755,11 @@ def test_copying_migrations_to_empty_directory
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

0 comments on commit b6793ba

Please sign in to comment.