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:
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r--app/models/milestone.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index d300b938fc0..8de717fb61d 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -10,6 +10,7 @@ class Milestone < ApplicationRecord
include IidRoutes
include UpdatedAtFilterable
include EachBatch
+ include Spammable
prepend_mod_with('Milestone') # rubocop: disable Cop/InjectEnterpriseEditionModule
@@ -62,6 +63,9 @@ class Milestone < ApplicationRecord
validate :parent_type_check
validate :uniqueness_of_title, if: :title_changed?
+ attr_spammable :title, spam_title: true
+ attr_spammable :description, spam_description: true
+
state_machine :state, initial: :active do
event :close do
transition active: :closed
@@ -255,6 +259,10 @@ class Milestone < ApplicationRecord
end
end
+ def check_for_spam?(*)
+ spammable_attribute_changed? && parent.public?
+ end
+
private
def timebox_format_reference(format = :iid)