iban_bic 1.4.2 → 1.4.3
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 29b8179fb169e953a9eb678c7eb6ce155949083615134466aa2b55b05f1c8dab
|
4
|
+
data.tar.gz: 7f541e2e670a0139b15e4be2c9d997a0dd02f97e6f7310ce6b768b57039ff650
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f381e9984afed963f7cc22a7440cfc39058fde74b0d7650255d369109ce1202bf0ef947ab378857b0e0a0f3680b5a6e308ac0a016bce060ff5733529d11f964
|
7
|
+
data.tar.gz: f990ed3fa2c8fef5f6c949383626c1c35ff9d0583a2f1365b32360983e5a9391ee2f0b1adb6b0212ef239165f2e3ef75aa3b8dd5cc27b4a3062ddf39726e9609
|
data/README.md
CHANGED
@@ -132,7 +132,7 @@ $ bundle exec rake iban_bic:load_data
|
|
132
132
|
3.b. Using static data from YAML files
|
133
133
|
|
134
134
|
Create an initializer file for configuration:
|
135
|
-
|
135
|
+
|
136
136
|
```bash
|
137
137
|
$ bundle exec rails generate iban_bic:install --with-static-data
|
138
138
|
```
|
@@ -140,6 +140,10 @@ $ bundle exec rails generate iban_bic:install --with-static-data
|
|
140
140
|
4. Customize initializer if needed, adding validations for new countries, or overriding YAML files.
|
141
141
|
|
142
142
|
## Changelog
|
143
|
+
#### 1.4.3
|
144
|
+
|
145
|
+
* Fixed validators to avoid failing when values are `nil`.
|
146
|
+
|
143
147
|
#### 1.4.2
|
144
148
|
|
145
149
|
* Dependencies security update.
|
@@ -9,6 +9,8 @@ module ActiveModel
|
|
9
9
|
module Validations
|
10
10
|
class BicValidator < ActiveModel::EachValidator
|
11
11
|
def validate_each(record, attribute, value)
|
12
|
+
return unless value.present?
|
13
|
+
|
12
14
|
country_field = options[:country] ? record[options[:country]] : "[A-Z]{2}"
|
13
15
|
record.errors.add(attribute, :invalid_format) unless /^[A-Z]{4}#{country_field}[0-9A-Z]{2}([0-9A-Z]{3})?$/.match? value.upcase
|
14
16
|
end
|
@@ -9,6 +9,8 @@ module ActiveModel
|
|
9
9
|
module Validations
|
10
10
|
class IbanValidator < ActiveModel::EachValidator
|
11
11
|
def validate_each(record, attribute, value)
|
12
|
+
return unless value.present?
|
13
|
+
|
12
14
|
if !IbanBic.parse(value)
|
13
15
|
record.errors.add(attribute, :invalid_format)
|
14
16
|
elsif !IbanBic.valid_check?(value)
|
data/lib/iban_bic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iban_bic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonardo Diez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 5.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 5.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: regexp-examples
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
169
|
version: '0'
|
170
170
|
requirements: []
|
171
171
|
rubyforge_project:
|
172
|
-
rubygems_version: 2.
|
172
|
+
rubygems_version: 2.7.7
|
173
173
|
signing_key:
|
174
174
|
specification_version: 4
|
175
175
|
summary: IBAN and BIC tools for Rails applications
|