email_domain_inclusion 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/email_domain_inclusion/version.rb +1 -1
- data/lib/email_domain_inclusion.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d12f9c8c99ed1996f90eb137056443a647e420f3
|
4
|
+
data.tar.gz: ba156a62f1c094b180ef3f17820039bd9056a32c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5fc98326315cc1ec82a6ed01313da66fff4bda9ce332c5b73ce132608c31ea92101bfc46129cf6e1634ceae70598264ffe7b1cda46321b4d79097e3e0a338c4
|
7
|
+
data.tar.gz: 63ab7671903ff83700a1801e1362efc7116a6a3fdb61cc2a48683537bc7f70ae9df1e8fa877e023e37536772444319abd404e448b82d16636c151281d7fec672
|
@@ -6,7 +6,7 @@ require "email_domain_inclusion/version"
|
|
6
6
|
class EmailDomainInclusionValidator < ActiveModel::EachValidator
|
7
7
|
def validate_each(record, attribute, value)
|
8
8
|
domains = options[:allowed_domains]
|
9
|
-
domains = domains.call if domains.respond_to?(:call)
|
9
|
+
domains = domains.call(record) if domains.respond_to?(:call)
|
10
10
|
domain = Mail::Address.new(value).try(:domain).try(:downcase)
|
11
11
|
unless domains.include?(domain)
|
12
12
|
record.errors[attribute] << options[:message] || "domain_not_in_list"
|