diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-03 09:08:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-03 09:08:42 +0000 |
commit | f14507e586a7f75f0fb71a1d8468b7361be860d4 (patch) | |
tree | a8aa547b517a7ae5626c902bfb558c1fc5386c4e /app/models/concerns | |
parent | f4d27d532e3abeecd1caffeb3a56e698ae982e5b (diff) | |
download | gitlab-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.rb | 11 |
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 |