diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-10-30 22:04:19 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 22:04:19 +0900 |
commit | 9ae3ddbb21ece10550c8fd37e0c12bab9f5a89f8 (patch) | |
tree | a42e2a5bf7807729aeeb7822fa89152dcb8115af /activerecord/test | |
parent | 6889e720ccd264ddcf47162742c347a4559a9129 (diff) | |
parent | cf1d75d95d06ce3ac9e3ab7f19ecc17b49530942 (diff) | |
download | rails-9ae3ddbb21ece10550c8fd37e0c12bab9f5a89f8.tar.gz rails-9ae3ddbb21ece10550c8fd37e0c12bab9f5a89f8.tar.bz2 rails-9ae3ddbb21ece10550c8fd37e0c12bab9f5a89f8.zip |
Merge pull request #19388 from yakara-ltd/fix-habtm-fixture-order
Avoid violating key constraints in fixture HABTM associations
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/fixtures_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index 82ca15b415..1092b9553f 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -619,6 +619,10 @@ class HasManyThroughFixture < ActiveRecord::TestCase assert_equal load_has_and_belongs_to_many["parrots_treasures"], rows["parrot_treasures"] end + def test_has_and_belongs_to_many_order + assert_equal ["parrots", "parrots_treasures"], load_has_and_belongs_to_many.keys + end + def load_has_and_belongs_to_many parrot = make_model "Parrot" parrot.has_and_belongs_to_many :treasures |