activemodel-csv_validator 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/config/locales/en.yml +1 -0
- data/config/locales/ja.yml +1 -0
- data/lib/activemodel/csv_validator/version.rb +1 -1
- data/lib/activemodel/validations/csv_validator.rb +4 -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: cb70efb8db9417e97271234408c30226f68d3762f6bead02ad62d32a35ab3174
|
4
|
+
data.tar.gz: a0f5e957d47de6f6a267df40cfeb43c42b95a68026ec66912d40aaf714babdee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3082350fdb33f663589223f7de9530bdb39d0195d5da153ec014c552cb437227330aed4324080021fb7c90363590b48dbdf1bcdb9b39e5f927d9fdeb58657db
|
7
|
+
data.tar.gz: 7adad3526afda27bb99ef778bfb779c6abd58b477d76c2f078c9df5199dc8f3706eafa801f88326476e7cce2686d04467fdcc71db87545cb099f621b17e8145b
|
data/README.md
CHANGED
data/config/locales/en.yml
CHANGED
data/config/locales/ja.yml
CHANGED
@@ -15,6 +15,10 @@ module ActiveModel
|
|
15
15
|
record.errors.add(attribute, :max_rows, **options.slice(:max).merge(rows: rows.size))
|
16
16
|
end
|
17
17
|
|
18
|
+
if options[:min].present? && rows.size < options[:min]
|
19
|
+
record.errors.add(attribute, :min_rows, **options.slice(:min).merge(rows: rows.size))
|
20
|
+
end
|
21
|
+
|
18
22
|
if options[:headers].present?
|
19
23
|
missing_headers = options[:headers] - rows.headers
|
20
24
|
if missing_headers.present?
|
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.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aki77
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|