Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Hanselka <alex@gitlab.com>2018-12-11 00:42:50 +0300
committerAlex Hanselka <alex@gitlab.com>2018-12-11 00:42:50 +0300
commitf77888fe0857c9f4a47133f434c741a510946767 (patch)
treeb227b60894474ba2c9a8864b66e4df65763b35b8 /app/models/concerns/fast_destroy_all.rb
parentd2120ff1e705799752e7d9704cae3f1896d8e186 (diff)
parent2d7dc668506a0576e231fbe290c89e47cf088300 (diff)
Merge branch '11-6-stable-prepare-rc5' into '11-6-stable'
Prepare 11.6 RC5 release See merge request gitlab-org/gitlab-ce!23704
Diffstat (limited to 'app/models/concerns/fast_destroy_all.rb')
-rw-r--r--app/models/concerns/fast_destroy_all.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/concerns/fast_destroy_all.rb b/app/models/concerns/fast_destroy_all.rb
index 2bfa7da6c1c..1e3afd641ed 100644
--- a/app/models/concerns/fast_destroy_all.rb
+++ b/app/models/concerns/fast_destroy_all.rb
@@ -70,13 +70,14 @@ module FastDestroyAll
module Helpers
extend ActiveSupport::Concern
+ include AfterCommitQueue
class_methods do
##
# This method is to be defined on models which have fast destroyable models as children,
# and let us avoid to use `dependent: :destroy` hook
- def use_fast_destroy(relation)
- before_destroy(prepend: true) do
+ def use_fast_destroy(relation, opts = {})
+ set_callback :destroy, :before, opts.merge(prepend: true) do
perform_fast_destroy(public_send(relation)) # rubocop:disable GitlabSecurity/PublicSend
end
end