summaryrefslogtreecommitdiff
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-08-05 17:10:08 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-08-15 13:18:15 -0500
commit43e756d4eafd79f4d2f366b646ebb94af78b5a4c (patch)
tree07949d3368affcda301fd266e1e5bf0649474b23 /app/models/issue.rb
parent7179165af7553720089a0b7e7024374c371e2f90 (diff)
downloadgitlab-ce-43e756d4eafd79f4d2f366b646ebb94af78b5a4c.tar.gz
Refactored AkismetHelper into AkismetService and cleaned up `Spammable`
- Refactored SpamCheckService into SpamService
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb13
1 files changed, 3 insertions, 10 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 40028e56489..ab98d0cf9df 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -37,7 +37,8 @@ class Issue < ActiveRecord::Base
scope :order_due_date_asc, -> { reorder('issues.due_date IS NULL, issues.due_date ASC') }
scope :order_due_date_desc, -> { reorder('issues.due_date IS NULL, issues.due_date DESC') }
- attr_spammable :title, :description
+ attr_spammable :title, spam_title: true
+ attr_spammable :description, spam_description: true
state_machine :state, initial: :opened do
event :close do
@@ -266,16 +267,8 @@ class Issue < ActiveRecord::Base
due_date.try(:past?) || false
end
- # To allow polymorphism with Spammable
+ # Only issues on public projects should be checked for spam
def check_for_spam?
super && project.public?
end
-
- def spam_title
- title
- end
-
- def spam_description
- description
- end
end