rails_validations 1.1 → 1.1.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: 1dbffdfff5db9e79c428f0f63703e7823f48ad06
4
- data.tar.gz: 20b3a0d8aa8c014eb0bf13d145e856dc229dcdd3
3
+ metadata.gz: ca94580d4d2e98cbf041af91b800f16ddbf00510
4
+ data.tar.gz: 08b0d19a8afb7578b6304803f0e58833f3fdfe92
5
5
  SHA512:
6
- metadata.gz: 375251bca3b2ced7f504d983fdcccbe7687b9f5d9513cf6ae1b8483e831e7f813010e4d4039ee04b43e0b483bebf60af5ff9eeaa47af2b83b0848bad17c0dbfc
7
- data.tar.gz: 49e34e36be5bf2f9818b3b4e34c54ce3c92917b24ab78a708e6ed4ada6c5f1faed0a32c19a65410ade7b0581e528dcc720d70f94b4d7625daf0851f299637d65
6
+ metadata.gz: 36e62bff1d8386a26e4a9791d40d88e7d9e46588bfec526eae1ec29da3dd0acb952ab1af95ac759f1354bd14b21d37d1385e279f2f2e52bd32a089a5afbd640f
7
+ data.tar.gz: 85b6b3f4a22432c73b4bd3e7e282e7ea512f0b8629562fe56205dd2d326a23b00461887c1620beddf6a1d7a820186e15670add9419b06b9774de2c034f1d25f2
@@ -73,6 +73,11 @@ Currently implemented countries:
73
73
  ChangeLog
74
74
  =========
75
75
 
76
+ version 1.1.1, 20141013
77
+ -----------------------
78
+ - Fix i18n key for `phone`
79
+ - Allow passing a Proc to `date` without an argument
80
+
76
81
  version 1.1, 20141003
77
82
  ---------------------
78
83
  - Make the date validation work if the column it points to is `nil`.
@@ -37,7 +37,11 @@ class DateValidator < ActiveModel::EachValidator
37
37
 
38
38
  options.slice(*CHECKS.keys).each do |option, raw_option_value|
39
39
  option_value = if raw_option_value.respond_to? :call
40
- raw_option_value.call record
40
+ if raw_option_value.parameters == []
41
+ raw_option_value.call
42
+ else
43
+ raw_option_value.call record
44
+ end
41
45
  elsif raw_option_value.is_a? Symbol
42
46
  record.send raw_option_value
43
47
  elsif raw_option_value.is_a? Fixnum
@@ -5,6 +5,6 @@ class PhoneValidator < ActiveModel::EachValidator
5
5
  \z/x.freeze
6
6
 
7
7
  def validate_each record, attribute, value
8
- record.errors.add attribute, (options[:message] || I18n.t('rails_validations.invalid_phone')) unless value =~ REGEXP
8
+ record.errors.add attribute, (options[:message] || I18n.t('rails_validations.phone.invalid')) unless value =~ REGEXP
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.1'
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Tournoij
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-03 00:00:00.000000000 Z
11
+ date: 2014-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack