diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-26 09:08:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-26 09:08:47 +0000 |
commit | 66d4203791a01fdedf668a78818a229ea2c07aad (patch) | |
tree | 374fc9f6c5e709cf6ab48e257e6bfe4a504d6bbb /app/models/concerns/spammable.rb | |
parent | a496f41f60e12a0a5c31482b7594ad547e0ade42 (diff) | |
download | gitlab-ce-66d4203791a01fdedf668a78818a229ea2c07aad.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns/spammable.rb')
-rw-r--r-- | app/models/concerns/spammable.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/concerns/spammable.rb b/app/models/concerns/spammable.rb index 10bbeecc2f7..7c12fe29ade 100644 --- a/app/models/concerns/spammable.rb +++ b/app/models/concerns/spammable.rb @@ -16,7 +16,7 @@ module Spammable attr_accessor :spam_log alias_method :spam?, :spam - after_validation :check_for_spam, on: [:create, :update] + after_validation :invalidate_if_spam, on: [:create, :update] cattr_accessor :spammable_attrs, instance_accessor: false do [] @@ -37,7 +37,7 @@ module Spammable end end - def check_for_spam + def invalidate_if_spam error_msg = if Gitlab::Recaptcha.enabled? "Your #{spammable_entity_type} has been recognized as spam. "\ "Please, change the content or solve the reCAPTCHA to proceed." |