sample_core_api 0.0.9.pre.8 → 0.0.9.pre.9

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: c6f83a2b2183ee268ef20ba591d8e1562385ff3407d65ec93a11cb5215be194e
4
- data.tar.gz: 1ff5d0a5036b12408e319f8a8e9b961ead73f1deca1dabdf0076bfd0ab3a7534
3
+ metadata.gz: dccb4a18eab1fd181a10a8a6e406031d901967d7250edd915a40e3cadb9e06d9
4
+ data.tar.gz: 82d0ba628a912397a3cd2eea67f4736b37a614634353f81ecab64aa7579f358a
5
5
  SHA512:
6
- metadata.gz: e678867ce46b92e5501732a8a6f932e4fc4f165725d03a3e2bc880819bddf8d6a612dd26d7021f78f2274f098920333a2658a027a5dfd0369730c733b448823d
7
- data.tar.gz: 5c775832d079e6a52830fa61419b3eae4ea2e3ff6a094765a436df786103e8e38d89bf5f1ce3df4b3c3db169bdd967c76788b779f9fe78e8d7a6d90fff42d27a
6
+ metadata.gz: 58f1283caf64da0514271f05600be53e589a5f3c75eeb006ea6280afb696b9196491c30ec3af6ce05c332f3eaefe431fdee67db180795326fbbe95c1c446645a
7
+ data.tar.gz: 31ddd062bd145e022db77b6be6ad3766a6ba2d5738a7c09c4f150dbfa4cf4f425f28064295585ae29bad73933fb51f813d0adea779eb0c5bab2e7f2af640e816
@@ -12,4 +12,12 @@ module Validator
12
12
  end
13
13
  }
14
14
  end
15
+
16
+ def convert_errors_response(error_list)
17
+ errors = []
18
+ error_list.each do |key, value|
19
+ errors << {field: key, message: value}
20
+ end
21
+ errors
22
+ end
15
23
  end
@@ -11,7 +11,7 @@ module RestResponseModel
11
11
  response = {
12
12
  status: error_code
13
13
  }
14
- response[:errors] = errors if errors.any?
14
+ response[:errors] = errors if !errors.nil? && errors.any?
15
15
  response
16
16
  end
17
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sample_core_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9.pre.8
4
+ version: 0.0.9.pre.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fusin Thang