Skip to content

Commit

Permalink
Fix CI failure due to remaining tagging records
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
kamipo committed Mar 26, 2019
1 parent 5883a72 commit b2b559c
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -21,7 +21,7 @@ def setup
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
Expand Down

0 comments on commit b2b559c

Please sign in to comment.