salestation 3.7.0 → 3.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c1c39aa648194b22cc8f4e75bccddaa3d51992c5fcd6c85facadb6960f52db0
4
- data.tar.gz: 9d2132d9c51921bec0146a5a22c7cc7f6c5dbbf3ef5a044cd1f405d4e4953e78
3
+ metadata.gz: 2fe9755ef3152c1d5e9821aa2a7be920245b35f7ee95f26fd1e0fe3fb5934468
4
+ data.tar.gz: f9b1e080731f605cfe7f3ccd2194b923fe70b668757198b105c5ee697ca29637
5
5
  SHA512:
6
- metadata.gz: 3f6ba6c35d4e30f10ee547b484457948602d19fcc91da64912bda45ed8043378bea84ceb29d2a5a6912be5c85eb4dc3bf4520b4c96b93e50e4a4e1bebeaf1c57
7
- data.tar.gz: c116c954f2a544fb5d100718f27c1a599aa1b83b7efa0d0216f365e1137af64d8811a5da362f0652497eb949816bb50e0e1276be0acef67b9caac4b55fefad6f
6
+ metadata.gz: c5988265e60fdfa3f8dc7fe1915e38cd6d3afc1aabeca923de08bf9726c21db355d04ce6d9047bfda8d7b8fa4773104fdacbd169a12de6c75ce702aafbd5e6dd
7
+ data.tar.gz: 1f3351524846ddea69d54281ab5262ffaa138a4fdf83092614030ca7d60bcb99d44a4944aa1690c04ecf88e41e39cf1d3209588e6730bd92566cf25e66393cec
@@ -41,6 +41,14 @@ module Salestation
41
41
  end
42
42
  end
43
43
 
44
+ class UnprocessableEntityError < Error
45
+ attribute :form_errors, Types::Hash.default({}.freeze)
46
+
47
+ def body
48
+ super.merge(form_errors: errors)
49
+ end
50
+ end
51
+
44
52
  class Success < Response
45
53
  attribute :status, Types::Strict::Integer
46
54
  attribute :body, Types::Strict::Hash | Types::Strict::Array
@@ -52,7 +60,7 @@ module Salestation
52
60
  message = parse_errors(errors)
53
61
  debug_message = parse_hints(hints)
54
62
 
55
- UnprocessableEntity.new(message: message, debug_message: debug_message)
63
+ UnprocessableEntity.new(message: message, debug_message: debug_message, form_errors: errors)
56
64
  end
57
65
 
58
66
  def self.parse_errors(errors)
@@ -99,7 +107,7 @@ module Salestation
99
107
  Conflict = Error.with_code(409)
100
108
  RequestEntityTooLarge = Error.with_code(413)
101
109
  UnsupportedMediaType = Error.with_code(415)
102
- UnprocessableEntity = Error.with_code(422)
110
+ UnprocessableEntity = UnprocessableEntityError.with_code(422)
103
111
 
104
112
  InternalError = Error.with_code(500)
105
113
  ServiceUnavailable = Error.with_code(503)
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "salestation"
7
- spec.version = "3.7.0"
7
+ spec.version = "3.8.0"
8
8
  spec.authors = ["Glia TechMovers"]
9
9
  spec.email = ["techmovers@glia.com"]
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salestation
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 3.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glia TechMovers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-25 00:00:00.000000000 Z
11
+ date: 2020-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler