pakyow-form 1.0.0.rc3 → 1.0.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pakyow/form/framework.rb +12 -5
  3. metadata +12 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15adfe5151259d10b24f9bf9a1da870150c0c7bb3656fb87a2b0ba7160ef198b
4
- data.tar.gz: be052eccf14a15f49fdbf9a6299a157b5dc1a705f26e4366299c9e9c72f881ac
3
+ metadata.gz: 5ddd2e7ea32aeb92a877564f3f14587ce5067ca3b32c67704afa727b4bc5e415
4
+ data.tar.gz: bdb34a32297846117e4a729e184707ebdc5fea6c2e5cac708978f6c23172808b
5
5
  SHA512:
6
- metadata.gz: 7fccca53972f9b3e76c2abb00acf61e8a2dd0d9bcfb8646b46c959c7d480d4d48b163c7c25a033a2151c690de98f88c20b4b689da8a786176ca442d1c29670b2
7
- data.tar.gz: d43e6fae0fad6accd340c284897decc3ba269ddfb8fea9c03322cbbbe5b321622968cee10cb4b71ae31bd09834860f05d3f73dd257c430f45eec9cbdac42b694
6
+ metadata.gz: c285af53510fd6e5f00734bdf736247d40ef29f396babd1f74c28f9ee2ffeaf71c54ea21369ccbc20f3c3a48d656b500bf339d47b042aea39533d1a7151c01b1
7
+ data.tar.gz: dd0295bcb05aaa0d5c759a21f43b4adace9a301ed65ae2a0021ece4c5196c28ed475a95c712101637c43f1c6f488dfb316efdcd16967dc4de794419acce638f9
@@ -34,22 +34,29 @@ module Pakyow
34
34
 
35
35
  handle InvalidData, as: :bad_request do |error|
36
36
  if connection.form && connection.form.include?(:origin)
37
- errors = case error.result.messages
37
+ raw_messages = case error.result
38
+ when Verifier::Result
39
+ error.result.messages(type: :presentable)
40
+ else
41
+ error.result.messages
42
+ end
43
+
44
+ errors = case raw_messages
38
45
  when Array
39
- error.result.messages.map { |message|
46
+ raw_messages.map { |message|
40
47
  { message: message }
41
48
  }
42
49
  when Hash
43
- error.result.messages.flat_map { |type, messages|
50
+ raw_messages.flat_map { |type, messages|
44
51
  case messages
45
52
  when Array
46
53
  messages.map { |type_message|
47
- { field: type, message: "#{Support.inflector.humanize(type)} #{type_message}" }
54
+ { field: type, message: type_message }
48
55
  }
49
56
  when Hash
50
57
  messages.flat_map { |field, field_messages|
51
58
  field_messages.map { |field_message|
52
- { field: field, message: "#{Support.inflector.humanize(field)} #{field_message}" }
59
+ { field: field, message: field_message }
53
60
  }
54
61
  }
55
62
  end
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.rc3
4
+ version: 1.0.0.rc4
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-09 00:00:00.000000000 Z
11
+ date: 2019-07-15 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.rc3
19
+ version: 1.0.0.rc4
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.rc3
26
+ version: 1.0.0.rc4
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.rc3
33
+ version: 1.0.0.rc4
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.rc3
40
+ version: 1.0.0.rc4
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.rc3
47
+ version: 1.0.0.rc4
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.rc3
54
+ version: 1.0.0.rc4
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.rc3
61
+ version: 1.0.0.rc4
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.rc3
68
+ version: 1.0.0.rc4
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.rc3
75
+ version: 1.0.0.rc4
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.rc3
82
+ version: 1.0.0.rc4
83
83
  description: Forms for Pakyow
84
84
  email: bryan@metabahn.com
85
85
  executables: []