email_validator 2.0.0 → 2.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
  SHA256:
3
- metadata.gz: da5f6cc330adef4786045236ce8a34a49ad638a5b42c7447e7585711e0dccca4
4
- data.tar.gz: 04eff8f220eaafdb748f8ba0bc1f8890f450b0620731b5c3a10c9125954b6e7b
3
+ metadata.gz: ede74c324c144cfd01a3f13a1782ecb45af661a794ac8361d9193939a1973174
4
+ data.tar.gz: 4a8dad3331c014a855e03fbcf40f2cdfdb4e0cc6f216775d579b571f8276cc0e
5
5
  SHA512:
6
- metadata.gz: 9b39cbd7c9d87a3274f6d4b570a7a774ef0a232e5171f561a384e2c287d3242d832e91fb0240437484b5a500da98ee9715a20a5a15247075fbfd4100d596b0b2
7
- data.tar.gz: 8907894a088e8a2c53c53eb346331abc561643b2316bd4f5132f8961bc9cb98e08dc3ea4cb930d3a038ad8199922c429047b314e75ff96f034f506936ae1621b
6
+ metadata.gz: 108a2f115956ceb9b3f53e9dac871589efc9169e99789cc0c7a5339fbcaa063e9b47f6872b9b9836fa19b53d6e42fade76fa33961b8896bf382cf54ff9aad53f
7
+ data.tar.gz: 7cde7e0065099b6b5739338190dc6712dd5d8781892f5d645a13f24b5f4c1f328d563fb324a74782fcae307a4786bfb025acd4a33250b65c8f6c9ab028626bcc
@@ -1,8 +1,4 @@
1
1
  rvm:
2
- - 1.9.3
3
- - 2.0.0
4
- - 2.1.10
5
- - 2.2.10
6
2
  - 2.3.8
7
3
  - 2.4.5
8
4
  - 2.5.3
data/Changes.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # HEAD
2
2
 
3
+ # 2.0.1
4
+
5
+ * Add email value to error details [f1sherman #50]
6
+ * CI doesn't test Ruby versions that no longer receive updates [f1sherman #51]
7
+
3
8
  # 2.0.0
4
9
 
5
10
  * Looser validation [#49]
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{email_validator}
3
- s.version = "2.0.0"
3
+ s.version = "2.0.1"
4
4
  s.authors = ["Brian Alexander"]
5
5
  s.description = %q{Email validator for Rails and ActiveModel.}
6
6
  s.email = %q{balexand@gmail.com}
@@ -23,7 +23,7 @@ class EmailValidator < ActiveModel::EachValidator
23
23
 
24
24
  def validate_each(record, attribute, value)
25
25
  if self.class.invalid?(value)
26
- record.errors.add(attribute, options[:message] || :invalid)
26
+ record.errors.add(attribute, :invalid, options.slice(:message).merge(value: value))
27
27
  end
28
28
  end
29
29
  end
@@ -128,6 +128,15 @@ describe EmailValidator do
128
128
  end
129
129
  end
130
130
 
131
+ describe "error details" do
132
+ subject { TestUser.new :email => 'invalidemail@' }
133
+ before { subject.valid? }
134
+
135
+ it "should add the default message" do
136
+ expect(subject.errors.details[:email]).to eq [{ error: :invalid, value: 'invalidemail@' }]
137
+ end
138
+ end
139
+
131
140
  describe "nil email" do
132
141
  it "should not be valid when :allow_nil option is missing" do
133
142
  expect(TestUser.new(:email => nil)).not_to be_valid
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Alexander
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-02 00:00:00.000000000 Z
11
+ date: 2019-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel