deep_unrest 0.1.9 → 0.1.10

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
  SHA1:
3
- metadata.gz: a9cfbdaef1aa33d938ddab66e9fc2f6ad141fcb3
4
- data.tar.gz: 304b75b0f0dbadac905ccfd0724266f94bba1fcc
3
+ metadata.gz: e7aa10e14eae9acbd80c7b653ab286dda09d01e1
4
+ data.tar.gz: 1ff8baa779ad96b4a48da949a8e0ad8dd4e7f996
5
5
  SHA512:
6
- metadata.gz: 49b0b0f3783a2031445fd06582c5c21a5e6d30bd2f58cab76c7258106f5f1fe09056ae1a39c87fb9ae5602e1d1a520662a1b631f60ce92570a69eeedd7458eae
7
- data.tar.gz: ca22b5fc8ba5cdc32c071e97c41a94a5732009c6f84e163763b2243b4f130abc0abf70f2adee66fbe9e5808351f930690548ca6d1d2d60438a18d2c125c822f2
6
+ metadata.gz: e29892394513884320436f1020669c5d89a8093a7385ce80e32212db274763726131dacbc2a017994f93187fe07acf8b73909094547c9b623dfeac4201dab407
7
+ data.tar.gz: 0ed4965e04a9810e851f5e22d62299705172b3f336b1508f3cd21b7315bc4d8541967ce9266fda264f166dd4e9a5617432f91ff890b859036cb1723fecc27067
@@ -47,6 +47,7 @@ module DeepUnrest
47
47
  params.permit(:redirect,
48
48
  data: [:destroy,
49
49
  :path,
50
+ :errorPath,
50
51
  { attributes: {} }])
51
52
  end
52
53
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeepUnrest
4
- VERSION = '0.1.9'
4
+ VERSION = '0.1.10'
5
5
  end
data/lib/deep_unrest.rb CHANGED
@@ -162,6 +162,7 @@ module DeepUnrest
162
162
  scope_type: scope_type,
163
163
  scope: scope,
164
164
  klass: to_class(type),
165
+ error_path: operation[:errorPath],
165
166
  id: id }
166
167
 
167
168
  context[:path] = operation[:path] unless scope_type == :show
@@ -348,9 +349,10 @@ module DeepUnrest
348
349
  def self.format_errors(operation, path_info, values)
349
350
  if operation
350
351
  return values.map do |msg|
352
+ base_path = operation[:error_path] || operation[:path]
351
353
  { title: "#{path_info[:field].humanize} #{msg}",
352
354
  detail: msg,
353
- source: { pointer: "#{operation[:path]}.#{path_info[:field]}" } }
355
+ source: { pointer: "#{base_path}.#{path_info[:field]}" } }
354
356
  end
355
357
  end
356
358
  values.map do |msg|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deep_unrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lynn Hurley