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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 127308673e6f84bd0e9e9a49fc0acaf8fbf805ec
4
- data.tar.gz: 7059c2ff901a6119375603b9487c0b68c4d3a959
3
+ metadata.gz: d12f9c8c99ed1996f90eb137056443a647e420f3
4
+ data.tar.gz: ba156a62f1c094b180ef3f17820039bd9056a32c
5
5
  SHA512:
6
- metadata.gz: a1d1f681f3e0a5e7bd9040fafb3539194e7654c40e61daa7f6f2a09ff4555cfbd9fcb07d3949f5126e6abf6e59e9dfe88e9c0d0cc6298ed6b4801c30965c1e07
7
- data.tar.gz: 46aeb5d447ea86a02f3b9fa9d18aa94f3f85d59157b1d43d458a6d8a00b493ac50558855a5d5b8b48911a715b98e66c96535aca6b5d9ea035695f5eb69ce36d4
6
+ metadata.gz: c5fc98326315cc1ec82a6ed01313da66fff4bda9ce332c5b73ce132608c31ea92101bfc46129cf6e1634ceae70598264ffe7b1cda46321b4d79097e3e0a338c4
7
+ data.tar.gz: 63ab7671903ff83700a1801e1362efc7116a6a3fdb61cc2a48683537bc7f70ae9df1e8fa877e023e37536772444319abd404e448b82d16636c151281d7fec672
@@ -1,3 +1,3 @@
1
1
  module EmailDomainInclusion
2
- VERSION = "0.0.1"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -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"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_domain_inclusion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Fecheyr