eco-helpers 2.1.10 → 2.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a10a887a29d2f0e2bbfba835c32c6fb2f35ed6cbbc674ad108ec1da81192d50
4
- data.tar.gz: afc195b30a643cffaadb8b2b271e5d83d4981d1fed3d4111525ec83279a6f825
3
+ metadata.gz: 335e1112db6baee9a3ddfa8ebe5bf66d6bd257c91c5c09808182683b07b7f408
4
+ data.tar.gz: e0b69526d52606752bb27c80f16534a8eb2cd3ae8e334cfe2576d71b37be596f
5
5
  SHA512:
6
- metadata.gz: 303c97a14c92ec6b0f6b0011726f8836a5d3cc2e096afc4fdcf991b3160e771015b4cf642fb781214b256d0119216a44710fbac4daab700c58950a0c01ca9a9d
7
- data.tar.gz: 52a52c731cd43dbb56dad4910a26ea5e3e1658f919ff78e6e15d7bc57383e03841e0642c12e801585600abc89f9571dad895b66208703402c25e2a252da46b59
6
+ metadata.gz: c07bd1e0009ce543d7f479a2bf5e21eada3b59e8e2a8e79c65b265b97fbd5c2a7a196f7ef6cd8ed8a8a979ea9ac7b59c29f986d16edac25b113369ece6bedcf9
7
+ data.tar.gz: c8e042cd62c67ad78db3f7cb2771c394142e471ca49b8dcf43351df4fa9b60f01e4f49df956775e0d842ddff7fea7cf6bc8d5fb309ac2f3c002ca06306dec361
data/CHANGELOG.md CHANGED
@@ -1,11 +1,26 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [2.1.11] - 2022-11-xx
4
+ ## [2.1.13] - 2022-11-xx
5
5
 
6
6
  ### Added
7
7
  ### Changed
8
8
  ### Fixed
9
+ - `Eco::API::Session::Batch::Errors#str` remove double up on error message
10
+ - wrong require
11
+
12
+ ## [2.1.12] - 2022-11-30
13
+
14
+ ### Fixed
15
+ - `Eco::API::Session::Batch::Errors#str` remove double up on error message
16
+ - wrong require
17
+
18
+ ## [2.1.11] - 2022-11-30
19
+
20
+ ### Changed
21
+ - Bring the `-set-supervisor` native case up to date
22
+ - `Eco::API::Session::Batch::Errors#errors`
23
+ - better error catching and description
9
24
 
10
25
  ## [2.1.10] - 2022-11-30
11
26
 
@@ -85,11 +85,16 @@ module Eco
85
85
  response = status[entry]
86
86
  if body = response.body
87
87
  errs = []
88
- if errs = body["errors"] || body["error"]
89
- errs = [errs].flatten(1).compact
90
- end
91
- if errs.empty? && !response.success?
92
- errs = [body["response"]].flatten(1).compact
88
+ case body
89
+ when Hash
90
+ if errs = (body["errors"] || body["error"])
91
+ errs = [errs].flatten(1).compact
92
+ end
93
+ if errs.empty? && !response.success?
94
+ errs = [body["response"]].flatten(1).compact
95
+ end
96
+ when String
97
+ errs = [body]
93
98
  end
94
99
  errs.each do |msg|
95
100
  arr.push(ErrorCache.new(
@@ -7,17 +7,11 @@ class Eco::API::UseCases::DefaultCases::SetSupervisorCase < Eco::API::Common::Lo
7
7
  update = session.new_job("main", "update", :update, usecase)
8
8
 
9
9
  micro.with_each_present(entries, people, options, log_starter: true) do |entry, person|
10
- micro.with_supervisor(entry.supervisor_id, people) do |supervisor|
11
- if supervisor
12
- update.add(person)
13
- person.supervisor_id = supervisor.id unless options.dig(:exclude, :supervisor)
14
- else
15
- unless !entry.supervisor_id
16
- session.logger.warn("Supervisor '#{entry.supervisor_id}' does not exist. Entry: #{entry.to_s(:identify)}")
17
- end
10
+ if entry.supervisor_id?
11
+ micro.set_supervisor(person, entry.supervisor_id, people, options) do |unknown_id|
12
+ session.logger.warn("Supervisor '#{entry.supervisor_id}' does not exist. Entry: #{entry.to_s(:identify)}")
18
13
  end
19
14
  end
20
15
  end
21
16
  end
22
-
23
17
  end
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "2.1.10"
2
+ VERSION = "2.1.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.10
4
+ version: 2.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura