summaryrefslogtreecommitdiff
path: root/app/models/concerns
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-03 09:08:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-03 09:08:42 +0000
commitf14507e586a7f75f0fb71a1d8468b7361be860d4 (patch)
treea8aa547b517a7ae5626c902bfb558c1fc5386c4e /app/models/concerns
parentf4d27d532e3abeecd1caffeb3a56e698ae982e5b (diff)
downloadgitlab-ce-f14507e586a7f75f0fb71a1d8468b7361be860d4.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns')
-rw-r--r--app/models/concerns/delete_with_limit.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/concerns/delete_with_limit.rb b/app/models/concerns/delete_with_limit.rb
new file mode 100644
index 00000000000..1ea18b6149b
--- /dev/null
+++ b/app/models/concerns/delete_with_limit.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+module DeleteWithLimit
+ extend ActiveSupport::Concern
+
+ class_methods do
+ def delete_with_limit(maximum)
+ limit(maximum).delete_all
+ end
+ end
+end