From 0c878ef304d984b7f0c73a6aad44764d4210584f Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 19 Nov 2020 17:26:21 +0000 Subject: [PATCH] FIX: Remove error for PostCreator in a transaction without skip_jobs (#11291) Partial revert of b143412be473bacb50bad4c0ef8909d6a4717b67 (the refactoring is not reverted) This broke a few things, so we need to investigate and make some changes before reinstating the error --- lib/post_creator.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/post_creator.rb b/lib/post_creator.rb index d38d76e8b79..b0f066ac2b6 100644 --- a/lib/post_creator.rb +++ b/lib/post_creator.rb @@ -199,12 +199,6 @@ class PostCreator end def create - if !Rails.env.test? && !@opts[:import_mode] - if ActiveRecord::Base.connection.open_transactions > 0 && !@opts[:skip_jobs] - raise "You must use 'skip_jobs = true' when creating a post inside a transaction, otherwise jobs won't run properly." - end - end - if valid? transaction do build_post_stats