debitcard_validator 0.1.0 → 0.2.0

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: 082b5e3c4198d07beea5f9650e1fd9744b0a6505
4
- data.tar.gz: d10babb549161582e91acfb13de15258c815a409
3
+ metadata.gz: ce664a091f8ccc5420c5c8d046ed009b084d752d
4
+ data.tar.gz: 415bf9b39b7354f3df688bc6654087e6d9cc1eed
5
5
  SHA512:
6
- metadata.gz: fcfe0c898eb20fa9ca43994d6c2bd70af2147958ebf37961103651ce275448b96138fbd51caaf4809242006a26e6d2b86db7de5e9493ebad4d80016896ec5d46
7
- data.tar.gz: 381f27afad07659e2302804582d92f893a669c7d60e9ad7713b12122dbd8325485e26f3f57066c185be42cb41713c7ebc02aa2982a1f12d7441c1b01e8ffde6c
6
+ metadata.gz: 294eedaaa80f4a836d240544f9f0d3912e92990a39a44e274e7d1ddbe461d6f80198dba6153b8c12b0eee047bca2c74be9dbd35536d992545a5a82baa5b7cc47
7
+ data.tar.gz: d74d4c77f10fbd841e98042e2288a9ce17e50dc6487ea434b22853bc106f2248c8111a1b004d049e1f5626aa687c0f041fec6703a8ed897536d339edfa75600d
@@ -6,11 +6,11 @@ module ActiveModel
6
6
  def validate_each(record, attribute, value)
7
7
  value = trim_number(value)
8
8
  if value =~ debitcard_regexes
9
- record.errors.add(attribute, 'is debitcard.')
9
+ record.errors.add(attribute, :is_debitcard || 'is debitcard.')
10
10
  end
11
11
 
12
12
  if value =~ prepaidcard_regexes
13
- record.errors.add(attribute, 'is prepaidcard.')
13
+ record.errors.add(attribute, :is_prepaidcard || 'is prepaidcard.')
14
14
  end
15
15
  end
16
16
 
@@ -1,3 +1,3 @@
1
1
  module DebitcardValidator
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/locales/en.yml ADDED
@@ -0,0 +1,5 @@
1
+ en:
2
+ errors:
3
+ messages:
4
+ is_debitcard: 'is debitcard.'
5
+ is_prepaidcard: 'is prepaidcard.'
data/locales/ja.yml ADDED
@@ -0,0 +1,5 @@
1
+ ja:
2
+ errors:
3
+ messages:
4
+ is_debitcard: 'はデビットカードの番号です'
5
+ is_prepaidcard: 'はプリペイドカードの番号です'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debitcard_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuta Kurotaki
@@ -86,6 +86,8 @@ files:
86
86
  - lib/active_model/validations/debitcard_validator.rb
87
87
  - lib/debitcard_validator.rb
88
88
  - lib/debitcard_validator/version.rb
89
+ - locales/en.yml
90
+ - locales/ja.yml
89
91
  homepage: https://github.com/kurotaky/debitcard_validator
90
92
  licenses: []
91
93
  metadata: {}