bank-validator 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75e778293f28fae436fd12a7a36b2de3139868de
4
- data.tar.gz: e95a402a728da38a3bba1ff247765ce8950c2851
3
+ metadata.gz: 4e50ae23a715911b48b2719007826a9cade6f052
4
+ data.tar.gz: ff4026eb0d5ade84c6d5d60e48f68d7589e6b0e2
5
5
  SHA512:
6
- metadata.gz: 2a6658578af3c9003c446d1b4c2f92b9a76f12448e3867eeb27ed2c8bcf955cfa0d7ce72d015fca9e7b340e8078288c660787800abff4a87f116c08cc1dacac7
7
- data.tar.gz: 1d302fad9d55ee487fba7ae70085576a9515b74538905e464fcc0c23d3c9277da8e73b26a2bcb0192da2d24924d23afb5bf7dafcd8a31dcc4b9c9f0624c1d8a7
6
+ metadata.gz: fe563fd57de306b2a158ea02fc43e22e573b863ea9174f89d79df90ce534290d9d2b82b63e6b7f8343d37c11ef7c06101c282089c94571c069386b6c73e7fd38
7
+ data.tar.gz: 4846d208591cde4ec4168882b0cc2a76e668d295fbc8cbbab55a2835299e13ef601ffbcc27c6024c0edf431984bf01823dd6e31975631f16e27565d8b10bb73b
data/README.md CHANGED
@@ -28,7 +28,9 @@ validates :bic, bic: true
28
28
  validates :routing_number, routing_number: true
29
29
  ```
30
30
 
31
- Now you're ready to go!
31
+ You can also pass custom messages to your validations. Otherwise the symbols `:invalid_iban`, `:invalid_bic`, `:invalid_routing_number` are returned, which you can map to internationalized error messages.
32
+
33
+ Now you're ready to go!
32
34
 
33
35
  ## Contributing to bank-validator
34
36
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: bank-validator 0.2.1 ruby lib
5
+ # stub: bank-validator 0.2.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "bank-validator"
9
- s.version = "0.2.1"
9
+ s.version = "0.2.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -9,7 +9,7 @@ class BicValidator < ActiveModel::EachValidator
9
9
  private
10
10
 
11
11
  def record_error(record, attribute, value)
12
- record.errors.add(attribute, :invalid_bic)
12
+ record.errors.add(attribute, (:invalid_bic || options[:message]))
13
13
  end
14
14
 
15
15
  def regexp
@@ -9,7 +9,7 @@ class IbanValidator < ActiveModel::EachValidator
9
9
  private
10
10
 
11
11
  def record_error(record, attribute, value)
12
- record.errors.add(attribute, :invalid_iban)
12
+ record.errors.add(attribute, (:invalid_iban || options[:message]))
13
13
  end
14
14
 
15
15
  def regexp
@@ -9,7 +9,7 @@ class RoutingNumberValidator < ActiveModel::EachValidator
9
9
  private
10
10
 
11
11
  def record_error(record, attribute, value)
12
- record.errors.add(attribute, :invalid_iban)
12
+ record.errors.add(attribute, (:invalid_routing_number || options[:message]))
13
13
  end
14
14
 
15
15
  def regexp
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ~/Workspace/bank-validator
3
3
  specs:
4
- bank-validator (0.1.0)
4
+ bank-validator (0.2.1)
5
5
  activemodel (>= 3.0)
6
6
  activerecord (>= 3.0)
7
7
  activesupport (>= 3.0)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bank-validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Bahlke