aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-03-26 12:45:38 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-03-26 12:59:16 +0900
commitb2b559c75cf7c8f1dc6f22057b7780c72f45af51 (patch)
tree599a9246e416ad2f27467007cd8644d403d828c3 /activerecord
parent5883a7209239dfe7e6de1b5db210ad4912bc01bc (diff)
downloadrails-b2b559c75cf7c8f1dc6f22057b7780c72f45af51.tar.gz
rails-b2b559c75cf7c8f1dc6f22057b7780c72f45af51.tar.bz2
rails-b2b559c75cf7c8f1dc6f22057b7780c72f45af51.zip
Fix CI failure due to remaining tagging records
`TRUNCATE TABLE posts` also resets `AUTO_INCREMENT`. If newly created a post, it is wrongly associated with remaining tagging records. To un-associate remaining tagging record, use `post.create_tagging!` instead. Fixes #35751.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb b/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb
index 5fca972aee..673d5f1dcf 100644
--- a/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb
+++ b/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb
@@ -21,7 +21,7 @@ module PolymorphicFullStiClassNamesSharedTest
ActiveRecord::Base.store_full_sti_class = store_full_sti_class
post = Namespaced::Post.create(title: "Great stuff", body: "This is not", author_id: 1)
- @tagging = Tagging.create(taggable: post)
+ @tagging = post.create_tagging!
end
def teardown