iban_bic 1.4.0 → 1.4.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: f7b2f833a71bf207363496a6140a16d97de02395
4
- data.tar.gz: d35302a1fdd34187d969477b0205eabd45ba795d
3
+ metadata.gz: 38a619312e6705eacf447c6a99e53c17248dec59
4
+ data.tar.gz: ef5eb8a721913d59c7b73e8bb42230119917ce00
5
5
  SHA512:
6
- metadata.gz: 45b4e30101e361d6f92d0d9441574a3d0d03cbea192667194cee19935822d90b325257eb446e083b8411b0ce13d2455ea1915dc8e2b5b3c6c4434f356a61b770
7
- data.tar.gz: 3ecf0d1ec09baf2850ac0b8fe640e8c6ee66e67947886b42854327186bcad59a17f927ebbd37c71c4b93928204889d62ba0a40acc2874047b0c93a2f375f76b9
6
+ metadata.gz: bc838ce23198c4566aea393512a5913f18bc0d3168ae0eabf1fd27dfaae66d0181d5b48a4b9071c67e08bc98d0b9cd78a7bc7b990e7ca98767d7b3f2e873fccb
7
+ data.tar.gz: 45bfbd9492b070f24c7c7fb99a79b975dd8b0b9f0dcd1fd878181776a1897b55e0d60cdd8d34b62da32e2373b66774919a2b9c10cbf913a6fea1868bb66d08f5
data/README.md CHANGED
@@ -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.1
144
+
145
+ * Fixed BIC validation, don't allow less 1 or 2 characters for the office code and don't allow to add extra characters at the begining or at the end of the string.
146
+
143
147
  #### 1.4.0
144
148
 
145
149
  * BIC validation moved from BIC model to an independent validator.
@@ -10,7 +10,7 @@ module ActiveModel
10
10
  class BicValidator < ActiveModel::EachValidator
11
11
  def validate_each(record, attribute, value)
12
12
  country_field = options[:country] ? record[options[:country]] : "[A-Z]{2}"
13
- unless /[A-Z]{4}#{country_field}[0-9A-Z]{2,5}/.match? value.upcase
13
+ unless /^[A-Z]{4}#{country_field}[0-9A-Z]{2}([0-9A-Z]{3})?$/.match? value.upcase
14
14
  record.errors.add(attribute, :invalid_format)
15
15
  end
16
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IbanBic
4
- VERSION = "1.4.0"
4
+ VERSION = "1.4.1"
5
5
  end
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.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonardo Diez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-27 00:00:00.000000000 Z
11
+ date: 2018-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails