From d730b69eb26ab5917b773a242c21f5967661d964 Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Mon, 20 Mar 2017 23:37:29 -0300 Subject: Spam check only when spammable attributes have changed --- app/models/snippet.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models/snippet.rb') 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 -- cgit v1.2.1