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:
authorOswaldo Ferreira <oswaldo@gitlab.com>2017-03-21 05:37:29 +0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2017-03-21 20:20:15 +0300
commitd730b69eb26ab5917b773a242c21f5967661d964 (patch)
treea295e3a825afb93f189adda53dfc83401439b4d9 /app/models/snippet.rb
parent86ef67eee559c536e159673b26fb524c92d2eb82 (diff)
Spam check only when spammable attributes have changed
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r--app/models/snippet.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index dbd564e5e7d..30aca62499c 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -132,7 +132,8 @@ class Snippet < ActiveRecord::Base
end
def check_for_spam?
- public?
+ visibility_level_changed?(to: Snippet::PUBLIC) ||
+ (public? && (title_changed? || content_changed?))
end
def spammable_entity_type