tramway-api 1.8.6.5 → 1.8.6.6

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: a073d2cac39ca7ee025468a271a4a85ba900c81693d62556ac76f1c7962882e2
4
- data.tar.gz: 34fadb2c4df760f32bc76d14a2c25fa2c1e9819c3c6a738a82e0ba05d7535b1a
3
+ metadata.gz: c073884812f246c0b76d5367b19c2f1348dbe8539286b08027487e716e2dd959
4
+ data.tar.gz: d49ede45c33a877a8deea8dcb9fb0285d1ef0d2154cd9e44109b0801e0280e4c
5
5
  SHA512:
6
- metadata.gz: 8a5f6ce365af846d668d355b7858e1ae31f3c8c4dd9afabaa8f9348cfb786c0fd470300bf904e1c381e14cd9499e286154cabd62401fee14e8c896062b6443ea
7
- data.tar.gz: c8ab7d0c75fb7d51ea2c9b2d9173120114387eaed83541f3e0ca9d41c12c874c311e492163769410a06c980648633ed1dbfa55b5a1a412be209b62ab980d6fbb
6
+ metadata.gz: a26de6225b11387505eac518f7d2ddec5ea0d3070007f6838e4d5192e9296793eed0f2c38af2a445286fffc0fc4f2bdb65fb449f32a6c64e4be13d2c51ce1270
7
+ data.tar.gz: 33e67a11a31f45d4413d8f24a8f7a75075a38f74f3f99cb0456be838f59ccf38acf0f3cf4649cc27c6fb054e0f4349ff0b78fbf241a66204650685ab7f95d4b7
@@ -22,21 +22,23 @@ class Tramway::Api::V1::ErrorSerializer < ActiveModel::Serializer
22
22
  end
23
23
  end
24
24
 
25
- if object.model
26
- object.model.errors.messages.each do |name, messages|
27
- error_messages.merge!((path + [name]).join('/') => messages)
25
+ if object.respond_to? :model
26
+ if object.model
27
+ object.model.errors.messages.each do |name, messages|
28
+ error_messages.merge!((path + [name]).join('/') => messages)
29
+ end
28
30
  end
29
- end
30
31
 
31
- object.model&.attributes&.each do |attribute_key, attribute_value|
32
- if attribute_value.is_a?(Array)
33
- attribute_value.each_with_index do |array_attribute_value, array_attribute_key|
34
- error_messages.merge!(
35
- error_messages(
36
- array_attribute_value,
37
- path + [attribute_key] + [array_attribute_key]
32
+ object.model&.attributes&.each do |attribute_key, attribute_value|
33
+ if attribute_value.is_a?(Array)
34
+ attribute_value.each_with_index do |array_attribute_value, array_attribute_key|
35
+ error_messages.merge!(
36
+ error_messages(
37
+ array_attribute_value,
38
+ path + [attribute_key] + [array_attribute_key]
39
+ )
38
40
  )
39
- )
41
+ end
40
42
  end
41
43
  end
42
44
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Api
5
- VERSION = '1.8.6.5'
5
+ VERSION = '1.8.6.6'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.6.5
4
+ version: 1.8.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov