kirico 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kirico/config/locales/en.yml +1 -0
- data/lib/kirico/config/locales/ja.yml +1 -0
- data/lib/kirico/models/form.rb +14 -7
- data/lib/kirico/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28534524bcc437fdf758e1d22da04ec2466196b0
|
4
|
+
data.tar.gz: cf58e75afffd2437f309309a0c94c270322bbb3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4a204454daf43b2e2817a0f75ce67f5bdfd9fe6b08be3bea6fc3023e70c09ba8e574c4d1c6d5d299d2caaf4ec926a1fb1d51be0fe85602bf6a569ca2594265e
|
7
|
+
data.tar.gz: 7f46f860418f9bd7da4906d867420bee5ab507dfc3943d624985889bdb7f00d11adb627572c7792f33e039b17f897ce59103d1add80a2e9782e784581550249f
|
data/lib/kirico/models/form.rb
CHANGED
@@ -40,13 +40,20 @@ module Kirico
|
|
40
40
|
|
41
41
|
# 子のエラーを自身のエラーとして設定する
|
42
42
|
def validate_children
|
43
|
-
[:fd, :company, :company_count
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
[:fd, :company, :company_count].each do |attribute|
|
44
|
+
rec = send(attribute)
|
45
|
+
next if rec.nil? || rec.valid?
|
46
|
+
rec.errors.full_messages.each do |msg|
|
47
|
+
errors.add(attribute, msg)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# 2行以上存在する場合は、何行目でエラーが起きたのかを知りたい
|
52
|
+
records.each.with_index(1) do |rec, i|
|
53
|
+
next if rec.valid?
|
54
|
+
row = I18n.t('errors.row_counter', num: i) if records.length > 1
|
55
|
+
rec.errors.full_messages.each do |msg|
|
56
|
+
errors.add(:records, "#{row}#{msg}")
|
50
57
|
end
|
51
58
|
end
|
52
59
|
end
|
data/lib/kirico/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kirico
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kakipo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|