email_domain_inclusion 1.0.0 → 1.0.1

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: d12f9c8c99ed1996f90eb137056443a647e420f3
4
- data.tar.gz: ba156a62f1c094b180ef3f17820039bd9056a32c
3
+ metadata.gz: d318ade615cedb1ac5bcf68c0e0eb63db0464c15
4
+ data.tar.gz: 08c9ec75e158420cdf33cf57f956c648ed84bf87
5
5
  SHA512:
6
- metadata.gz: c5fc98326315cc1ec82a6ed01313da66fff4bda9ce332c5b73ce132608c31ea92101bfc46129cf6e1634ceae70598264ffe7b1cda46321b4d79097e3e0a338c4
7
- data.tar.gz: 63ab7671903ff83700a1801e1362efc7116a6a3fdb61cc2a48683537bc7f70ae9df1e8fa877e023e37536772444319abd404e448b82d16636c151281d7fec672
6
+ metadata.gz: 8102f7ffa3a733cc7722b39bbadb3b82347d414483566eaf8b6baf49b8288e0399921dd61e47cde4965bcaa6094a71992abd5f91b1a9e941e81edbc9a3164b95
7
+ data.tar.gz: 1451ed88dc08719036a46a485fa965aa7d49175a48f47fbd7ffb0f328b354abfc05b9e98df8642689e60e0222a5dff77cee9e520e39f8bd1cd4dbcdbcb86c504
@@ -6,8 +6,8 @@ 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(record) if domains.respond_to?(:call)
10
9
  domain = Mail::Address.new(value).try(:domain).try(:downcase)
10
+ domains = domains.call if domains.respond_to?(:call)
11
11
  unless domains.include?(domain)
12
12
  record.errors[attribute] << options[:message] || "domain_not_in_list"
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module EmailDomainInclusion
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_domain_inclusion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Fecheyr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-30 00:00:00.000000000 Z
11
+ date: 2015-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler