diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-03-21 05:37:29 +0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-03-21 20:20:15 +0300 |
commit | d730b69eb26ab5917b773a242c21f5967661d964 (patch) | |
tree | a295e3a825afb93f189adda53dfc83401439b4d9 /app/models/snippet.rb | |
parent | 86ef67eee559c536e159673b26fb524c92d2eb82 (diff) |
Spam check only when spammable attributes have changed
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r-- | app/models/snippet.rb | 3 |
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 |