diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2018-12-05 17:01:12 +0300 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2018-12-07 00:00:19 +0300 |
commit | 4ded04119ce70f7a5dd8a49434675355563b591e (patch) | |
tree | 796c3becb8b910ee86050611b512890e45ce81d9 /app/models/concerns/with_uploads.rb | |
parent | 9ccf8d032ff82841cdfe96e2abe4b1d317058244 (diff) |
Allow pass additional options to use_fast_destroy
These options are then used when setting before destroy callback.
Diffstat (limited to 'app/models/concerns/with_uploads.rb')
-rw-r--r-- | app/models/concerns/with_uploads.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/app/models/concerns/with_uploads.rb b/app/models/concerns/with_uploads.rb index 761b40893b4..83b085ccce8 100644 --- a/app/models/concerns/with_uploads.rb +++ b/app/models/concerns/with_uploads.rb @@ -31,13 +31,9 @@ module WithUploads # TODO: when feature flag is removed, we can use just dependent: destroy # option on :file_uploads - before_destroy :remove_file_uploads + before_destroy :remove_file_uploads, unless: :fast_destroy_enabled? - use_fast_destroy :file_uploads - end - - def perform_fast_destroy(subject) - super if fast_destroy_enabled? + use_fast_destroy :file_uploads, if: :fast_destroy_enabled? end def retrieve_upload(_identifier, paths) |