salestation 3.9.0 → 4.0.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: c185cbbf51aa9e484fad4fc0099a9b518d11954f5c5c2f11d03f9d086fdeee08
4
- data.tar.gz: a8c356c5559e1ee1f02da859513badc848003d35cea3167ae66488c631309fca
3
+ metadata.gz: 56ea14b7773dbb2fa0af6c7c9cfacfb9e83da5d01df35b01ba8fb8b02658a95d
4
+ data.tar.gz: bb76fa431b6a680bb05cb0c5b251bc26b1c524472ce016bae0f90d39ba87a2cb
5
5
  SHA512:
6
- metadata.gz: c028e25b401034206c66be282335e78e903edac248adaabecd0041bd5a187397f7bda59d894ed35ded3132aed762e3c8596d4aeeee92f6c5b93fbb9549245ec6
7
- data.tar.gz: 4dc319fd28ae97aff269c0a6594a2cb271721da31c2ae48d7afd8927ccc352df1526fcfc486146ef55571788bca954de5649ce36a53b73c09767fb28eae99fb1
6
+ metadata.gz: 5609d652f5235ae824cf4f218db431aa4f4a71782f45e641915aeeef1a7dcd95d15abb67d233a36b953a453abe990bec451c12049fc7a4b072fb1733c526db44
7
+ data.tar.gz: 1ef99f606062c630da5ae971fab61c8f23bf1881c2a3b356c5f4bf0b765db7456fe4d9728dc1554e703f19fd73382d0de88fc2864bf01967e350168fab3b1fb8
@@ -44,10 +44,10 @@ module Salestation
44
44
  end
45
45
 
46
46
  class UnprocessableEntityError < Error
47
- attribute :form_errors, Types::Hash.default({}.freeze)
47
+ attribute? :form_errors, Types::Coercible::Hash.optional
48
48
 
49
49
  def body
50
- super.merge(form_errors: form_errors)
50
+ super.merge({form_errors: form_errors}.compact)
51
51
  end
52
52
  end
53
53
 
@@ -58,11 +58,16 @@ module Salestation
58
58
  end
59
59
 
60
60
  class UnprocessableEntityFromSchemaErrors
61
- def self.create(errors:, hints:, base_error: nil)
61
+ def self.create(errors:, hints:, base_error: nil, form_errors: false)
62
62
  message = parse_errors(errors)
63
63
  debug_message = parse_hints(hints)
64
64
 
65
- UnprocessableEntity.new(message: message, debug_message: debug_message, form_errors: errors, base_error: base_error)
65
+ UnprocessableEntity.new(
66
+ message: message,
67
+ debug_message: debug_message,
68
+ form_errors: form_errors ? errors : nil,
69
+ base_error: base_error
70
+ )
66
71
  end
67
72
 
68
73
  def self.parse_errors(errors)
data/salestation.gemspec CHANGED
@@ -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.9.0"
7
+ spec.version = "4.0.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.9.0
4
+ version: 4.0.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: 2021-01-14 00:00:00.000000000 Z
11
+ date: 2021-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler