deep_unrest 0.1.19 → 0.1.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/deep_unrest/version.rb +1 -1
- data/lib/deep_unrest.rb +10 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 298848186d99b08b61138ee69e64f4b7e1533323
|
4
|
+
data.tar.gz: 6e6e1d641b427c8bff316dddc5022645c4a0d9e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 294ef08f72dc4b7c75af39139be6860aca9728556e20856618a42bdd105f0e59a7559817ce6903f1a4a8cf64327fda14303cf44f49df91bd6b63af9a4a1495a7
|
7
|
+
data.tar.gz: 412601b198372de42790ca4985737d3ee9f876703d595fb3741000bfcad7a55edd8dbda7e053697e06814008ed53b869639c1b5adc2de4f0d660d077ec19327a
|
data/lib/deep_unrest/version.rb
CHANGED
data/lib/deep_unrest.rb
CHANGED
@@ -400,6 +400,15 @@ module DeepUnrest
|
|
400
400
|
rx.match(key)
|
401
401
|
end
|
402
402
|
|
403
|
+
# handle error titles in cases where error value is an array
|
404
|
+
def self.format_error_title(title)
|
405
|
+
if title.is_a?(Array)
|
406
|
+
title.join(', ')
|
407
|
+
else
|
408
|
+
title
|
409
|
+
end
|
410
|
+
end
|
411
|
+
|
403
412
|
def self.format_errors(operation, path_info, values)
|
404
413
|
if operation
|
405
414
|
return values.map do |msg|
|
@@ -415,7 +424,7 @@ module DeepUnrest
|
|
415
424
|
field_name].reject(&:empty?).compact.join('.')
|
416
425
|
deep_unrest_path = [operation[:dr_error_key],
|
417
426
|
field_name].compact.join('.')
|
418
|
-
{ title: "#{path_info[:field].humanize} #{msg}",
|
427
|
+
{ title: "#{path_info[:field].humanize} #{format_error_title(msg)}",
|
419
428
|
detail: msg,
|
420
429
|
source: { pointer: pointer,
|
421
430
|
deepUnrestPath: deep_unrest_path,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deep_unrest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lynn Hurley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|