From 23a267c75d7cd04e04d9faa1ab5a8d9b310430fb Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Tue, 26 Jul 2022 01:47:09 +0200 Subject: [PATCH] DEV: Fix `fabricator` deprecations (#17658) --- spec/fabricators/category_fabricator.rb | 2 +- spec/fabricators/post_fabricator.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/fabricators/category_fabricator.rb b/spec/fabricators/category_fabricator.rb index 06563200b30..5ffeff164e7 100644 --- a/spec/fabricators/category_fabricator.rb +++ b/spec/fabricators/category_fabricator.rb @@ -28,7 +28,7 @@ Fabricator(:private_category_with_definition, from: :private_category) do end Fabricator(:link_category, from: :category) do - before_validation { |category, transients| category.topic_featured_link_allowed = true } + before_create { |category, transients| category.topic_featured_link_allowed = true } end Fabricator(:mailinglist_mirror_category, from: :category) do diff --git a/spec/fabricators/post_fabricator.rb b/spec/fabricators/post_fabricator.rb index 9b3b5d85f1b..3a23e045c6b 100644 --- a/spec/fabricators/post_fabricator.rb +++ b/spec/fabricators/post_fabricator.rb @@ -7,7 +7,7 @@ Fabricator(:post) do post_type Post.types[:regular] # Fabrication bypasses PostCreator, for performance reasons, where the counts are updated so we have to handle this manually here. - after_save do |post, _transients| + after_create do |post, _transients| UserStatCountUpdater.increment!(post) end end