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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/activemodel/csv_validator/version.rb +1 -1
- data/lib/activemodel/validations/csv_validator.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95abecba8ae0bffe72895f880dbcd5c9768e614b740dce6da89f4520650b5e09
|
4
|
+
data.tar.gz: 556d59c009851f14a3a2f9d59bceb9239c0410a50f2bca15d3f68a359730f3d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f14e1ecdb9584790ced43f8150313cec548e2ef4e6127cbca137cc18b735bd48204ad946b5eb32121637bb4adae86b06594c057a720ba61187b7add41f32702b
|
7
|
+
data.tar.gz: dfd2d09f0930dcb109dc6de9ae599cb351503c20d775432d0a3db3c657fd31106ddc531ac187c4379be87ad1a4ffe834c2d48a23e9ec28df6f7a3021eb2af8ce
|
data/Gemfile.lock
CHANGED
@@ -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.
|
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:
|
11
|
+
date: 2020-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|