aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/create_join_table_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix `CustomCops/AssertNot` to allow it to have failure messageRyuta Kamizono2018-05-131-1/+1
| | | | Follow up of #32605.
* Replace `assert !` with `assert_not`Daniel Colson2018-04-191-6/+6
| | | | | This autocorrects the violations after adding a custom cop in 3305c78dcd.
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-1/+1
|
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* `create_join_table` should respect `references` column typeRyuta Kamizono2017-02-281-1/+12
| | | | | | | | Follow up of #26266. The default type of `primary_key` and `references` were changed to `bigint` since #26266. But `create_join_table` column type is still `integer`. It should respect `references` column type.
* `#tables` and `#table_exists?` and returns only tables and not viewsRafael Mendonça França2016-12-291-11/+9
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-3/+3
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-17/+17
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* add column type option to create_join_table to support uuidGreg Molnar2016-03-171-0/+7
|
* Deprecate `#table_exists?`, `#tables` and passing arguments to `#talbes`yui-knk2015-11-091-11/+13
| | | | | | | | | | Reported on #21509, how views is treated by `#tables` are differ by each adapters. To fix this different behavior, after Rails 5.0 is released, deprecate `#tables`. And `#table_exists?` would check both tables and views. To make their behavior consistent with `#tables`, after Rails 5.0 is released, deprecate `#table_exists?`.
* 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