pakyow-form 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pakyow/form/framework.rb +20 -13
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15adfe5151259d10b24f9bf9a1da870150c0c7bb3656fb87a2b0ba7160ef198b
|
4
|
+
data.tar.gz: be052eccf14a15f49fdbf9a6299a157b5dc1a705f26e4366299c9e9c72f881ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fccca53972f9b3e76c2abb00acf61e8a2dd0d9bcfb8646b46c959c7d480d4d48b163c7c25a033a2151c690de98f88c20b4b689da8a786176ca442d1c29670b2
|
7
|
+
data.tar.gz: d43e6fae0fad6accd340c284897decc3ba269ddfb8fea9c03322cbbbe5b321622968cee10cb4b71ae31bd09834860f05d3f73dd257c430f45eec9cbdac42b694
|
@@ -34,20 +34,27 @@ module Pakyow
|
|
34
34
|
|
35
35
|
handle InvalidData, as: :bad_request do |error|
|
36
36
|
if connection.form && connection.form.include?(:origin)
|
37
|
-
errors = error.result.messages
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
messages
|
45
|
-
|
46
|
-
|
37
|
+
errors = case error.result.messages
|
38
|
+
when Array
|
39
|
+
error.result.messages.map { |message|
|
40
|
+
{ message: message }
|
41
|
+
}
|
42
|
+
when Hash
|
43
|
+
error.result.messages.flat_map { |type, messages|
|
44
|
+
case messages
|
45
|
+
when Array
|
46
|
+
messages.map { |type_message|
|
47
|
+
{ field: type, message: "#{Support.inflector.humanize(type)} #{type_message}" }
|
47
48
|
}
|
48
|
-
|
49
|
-
|
50
|
-
|
49
|
+
when Hash
|
50
|
+
messages.flat_map { |field, field_messages|
|
51
|
+
field_messages.map { |field_message|
|
52
|
+
{ field: field, message: "#{Support.inflector.humanize(field)} #{field_message}" }
|
53
|
+
}
|
54
|
+
}
|
55
|
+
end
|
56
|
+
}
|
57
|
+
end
|
51
58
|
|
52
59
|
if app.class.includes_framework?(:ui) && ui?
|
53
60
|
data.ephemeral(:errors, form_id: connection.form[:id]).set(errors)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pakyow-form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Powell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pakyow-core
|
@@ -16,70 +16,70 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.0.
|
19
|
+
version: 1.0.0.rc3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.0.
|
26
|
+
version: 1.0.0.rc3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pakyow-data
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.0.0.
|
33
|
+
version: 1.0.0.rc3
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.0.0.
|
40
|
+
version: 1.0.0.rc3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: pakyow-presenter
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.0.0.
|
47
|
+
version: 1.0.0.rc3
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.0.0.
|
54
|
+
version: 1.0.0.rc3
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pakyow-routing
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.0.0.
|
61
|
+
version: 1.0.0.rc3
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.0.0.
|
68
|
+
version: 1.0.0.rc3
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pakyow-support
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.0.0.
|
75
|
+
version: 1.0.0.rc3
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.0.0.
|
82
|
+
version: 1.0.0.rc3
|
83
83
|
description: Forms for Pakyow
|
84
84
|
email: bryan@metabahn.com
|
85
85
|
executables: []
|