validates_iban 0.0.1 → 0.0.2

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: 1d421fdf28c53fe90889fbde805502e88c27c1ab
4
- data.tar.gz: d240be6b8103b9db353aed48c2d29f4f7f3c9395
3
+ metadata.gz: abba868d56a32e2489832c984af04473b1a148bb
4
+ data.tar.gz: 89f4ad424096d3307586db82e2040fa87e1d1eb8
5
5
  SHA512:
6
- metadata.gz: e015cc5c73c7ddc8d3bf25999dd710c461393d350fdc46a83a140408e9d350a2b199dee66cae6b67cdb0c55d73b9c690f30fdcf9fce21bc1911ccb7a31d52191
7
- data.tar.gz: a17eed1b6fa1029a347231fd58e0d9ea156d873ae401bd6911c3ddc29e71c110983208612a49c176afd518222ee0a229fd226bdf88d737e67a332a545a0cf9af
6
+ metadata.gz: 8b13ceae394d7522f4c9643dd0523b73d687d380bf3a31b861d75c874015af570ea511cd11e60049df596500958aa9a10cda47ccd318a2bb259bdd4ce5b58260
7
+ data.tar.gz: 6cf97e93a423f9651523c4687e5b73544add65149e81be08149406b880232a819fd470ab0de92f1546c8573d5d2e793826172ccccd0eb04b7a2a4b32fbee0985
@@ -2,13 +2,11 @@ require "iban-tools"
2
2
 
3
3
  class IbanValidator < ActiveModel::EachValidator
4
4
  def validate_each(object, attribute, value)
5
- if value.present?
6
- iban = IBANTools::IBAN.new(value)
7
- validation_errors = iban.validation_errors
5
+ iban = IBANTools::IBAN.new(value)
6
+ validation_errors = iban.validation_errors
8
7
 
9
- unless validation_errors.empty?
10
- object.errors[attribute] << (options[:message] || "is not a valid IBAN string: #{validation_errors.join(", ")}")
11
- end
8
+ unless validation_errors.empty?
9
+ object.errors[attribute] << (options[:message] || "is not a valid IBAN string: #{validation_errors.join(", ")}")
12
10
  end
13
11
  end
14
12
  end
@@ -1,3 +1,3 @@
1
1
  module ValidatesIban
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates_iban
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kasper Johansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-03 00:00:00.000000000 Z
11
+ date: 2015-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails