activemodel-csv_validator 0.1.0 → 0.1.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
  SHA256:
3
- metadata.gz: d6e9cb06ee2d9328efdd099140042880c6de947675f8fbc3dc185b23d5e00e5c
4
- data.tar.gz: 7f0b66a5ab3c7d84bb23fe6df2067418597da25a2aad708d816862b0a4d72bcf
3
+ metadata.gz: 95abecba8ae0bffe72895f880dbcd5c9768e614b740dce6da89f4520650b5e09
4
+ data.tar.gz: 556d59c009851f14a3a2f9d59bceb9239c0410a50f2bca15d3f68a359730f3d0
5
5
  SHA512:
6
- metadata.gz: d1a04a5fef137d27977093a4059a83dec3cf750ca3844fd925e40a9d6991b43e1519be0179681b25c791c88e6816b7a601637bb29528b3377fef120aa24fa2af
7
- data.tar.gz: ab5c1f9e00c10631ed418428b95ac1f6e758f4821e7898554c2403c7c4fd1a00fe79972c66c95cd8600f8678615b9b38b7027d69253dbaf04ed58d450268d98e
6
+ metadata.gz: f14e1ecdb9584790ced43f8150313cec548e2ef4e6127cbca137cc18b735bd48204ad946b5eb32121637bb4adae86b06594c057a720ba61187b7add41f32702b
7
+ data.tar.gz: dfd2d09f0930dcb109dc6de9ae599cb351503c20d775432d0a3db3c657fd31106ddc531ac187c4379be87ad1a4ffe834c2d48a23e9ec28df6f7a3021eb2af8ce
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activemodel-csv_validator (0.1.0)
4
+ activemodel-csv_validator (0.1.1)
5
5
  activemodel (>= 5.2.0)
6
6
  activesupport (>= 5.2.0)
7
7
 
@@ -1,5 +1,5 @@
1
1
  module Activemodel
2
2
  module CsvValidator
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -6,6 +6,8 @@ module ActiveModel
6
6
  module Validations
7
7
  class CsvValidator < ActiveModel::EachValidator
8
8
  def validate_each(record, attribute, value)
9
+ return if value.nil?
10
+
9
11
  content = NKF.nkf('-w', File.read(value.path, universal_newline: true))
10
12
  rows = CSV.parse(content, headers: :first_row, converters: :integer)
11
13
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemodel-csv_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - aki77
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-08 00:00:00.000000000 Z
11
+ date: 2020-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel