summaryrefslogtreecommitdiff
path: root/app/models/project_snippet.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-02-01 18:15:59 +0000
committerSean McGivern <sean@gitlab.com>2017-02-02 10:23:51 +0000
commitc63194ce6f952173649d7de4038aa96348e90565 (patch)
treea9622e1e5ffc86bf35fc9556152cc03cf2841ef5 /app/models/project_snippet.rb
parentf799585c41d801bc657f992adf3d4b201af927d2 (diff)
downloadgitlab-ce-c63194ce6f952173649d7de4038aa96348e90565.tar.gz
Check public snippets for spam
Apply the same spam checks to public snippets (either personal snippets that are public, or public snippets on public projects) as to issues on public projects.
Diffstat (limited to 'app/models/project_snippet.rb')
-rw-r--r--app/models/project_snippet.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/project_snippet.rb b/app/models/project_snippet.rb
index 25b5d777641..9bb456eee24 100644
--- a/app/models/project_snippet.rb
+++ b/app/models/project_snippet.rb
@@ -9,4 +9,8 @@ class ProjectSnippet < Snippet
participant :author
participant :notes_with_associations
+
+ def check_for_spam?
+ super && project.public?
+ end
end