aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/create_join_table_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* tests, favor `drop_table` and `:if_exists` over raw SQL.Yves Senn2015-03-021-1/+1
| | | | | We've replaced most querues using DROP TABLE in our tests already. This patch replaces the last couple calls.
* create_join_table uses same logic as HABTM reflectionsStefan Kanev2014-07-181-0/+24
| | | | | | | | Before this change, create_join_table would not remove the common prefix in the join table name, unlike ActiveRecord::Reflections. A HABTM between Music::Artist and Music::Record would use a table music_artists_records, while create_join table would create music_artists_music_records.
* Use teardown helper method.Guo Xiang Tan2014-03-141-2/+1
| | | | | | | | Follow-Up to https://github.com/rails/rails/pull/14348 Ensure that SQLCounter.clear_log is called after each test. This is a step to prevent side effects when running tests. This will allow us to run them in random order.
* Remove duplicated methods in command recorder and duplicated test nameCarlos Antonio da Silva2012-12-211-1/+1
|
* Add drop_join_table [#8267]Marc-Andre Lafortune2012-12-211-0/+42
|
* Move migration test together with other join table testsCarlos Antonio da Silva2012-11-211-0/+6
|
* Add join table migration generatorAleksey Magusev2012-07-181-3/+17
| | | | | | | | | | | | | For instance, running rails g migration CreateMediaJoinTable artists musics:uniq will create a migration with create_join_table :artists, :musics do |t| # t.index [:artist_id, :music_id] t.index [:music_id, :artist_id], unique: true end
* Use strings for the table namesRafael Mendonça França2012-07-011-1/+1
| | | | connection.tables returns an array of strings
* Refactor migration test_helperAleksey Magusev2012-07-011-14/+7
| | | | and create_join_table_test
* Add `create_join_table` migration helper to create HABTM join tablesRafael Mendonça França2012-01-271-0/+70