about summary refs log tree commit diff
path: root/app/validators
diff options
context:
space:
mode:
authorutam0k <k0ma@utam0k.jp>2017-10-04 22:16:10 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-10-04 15:16:10 +0200
commitb3af3f9f8cd5ed9c7ee06452e981b1b7734e1d89 (patch)
tree8ea106d91d77f83a1c0b368d8657203c544e7eca /app/validators
parentd5091387c6ddbe03b118b0cfb6d74cf821b84fb2 (diff)
Implement EmailBlackList (#5109)
* Implement BlacklistedEmailDomain

* Use Faker::Internet.domain_name

* Remove note column

* Add frozen_string_literal comment

* Delete unnecessary codes

* Sort alphabetically

* Change of wording

* Rename BlacklistedEmailDomain to EmailDomainBlock
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/blacklisted_email_validator.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/validators/blacklisted_email_validator.rb b/app/validators/blacklisted_email_validator.rb
index 0ba79694b..3f203f49a 100644
--- a/app/validators/blacklisted_email_validator.rb
+++ b/app/validators/blacklisted_email_validator.rb
@@ -12,6 +12,7 @@ class BlacklistedEmailValidator < ActiveModel::Validator
   end
 
   def on_blacklist?(value)
+    return true if EmailDomainBlock.block?(value)
     return false if Rails.configuration.x.email_domains_blacklist.blank?
 
     domains = Rails.configuration.x.email_domains_blacklist.gsub('.', '\.')