eco-helpers 1.3.8 → 1.3.13

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: 4eb9a6d4fc09ab97362ab384856a32562c1f61321277e2537f1cc6859a5a4d54
4
- data.tar.gz: 550fd9ce9a7510dca05bbcd80c153d7c114a25798e5d5af89059351db13f4b7d
3
+ metadata.gz: 5b59fa190429f792010af645ab28370ef0132ad17fafca035a363722736ab01e
4
+ data.tar.gz: c35a11ee4935356f1a93a008b63b520bd0809ef3a3d12d2b71e5329eb9f721f8
5
5
  SHA512:
6
- metadata.gz: ef1c26368f22e5b06ead30ab4aeb042d337fbfb5cd2b68369aa1407350993e38109e7cfde86295e046fcbcc5295a87a97da3cefd91873460cd7a3e535471afb1
7
- data.tar.gz: 84f36840162ec228b41a923476aae26917ab1254c4c4e86e848b9b276ea84f0e1a33a69f9c0e8c15497262cebfd99151b91a6dd7a2b7779105096ee97593285d
6
+ metadata.gz: e9d7f407038348bfb98bc8c1cf127d73108f3e90b92d3cd267f8c1868a1fad5810226506e4112f7c87d9deb6775af2d7ad94bb27dfd4c6c2ea2885b28f7b6c76
7
+ data.tar.gz: 90c6d245f2eb3fbfa1729765cf7629792eadbd33b84c58333aaac6a7e6a81d395fa150c4ff9c240c24403976c25d471d510441b849159aeaf67a593c19258db1
data/.yardopts CHANGED
@@ -6,5 +6,4 @@
6
6
  --output-dir ./doc
7
7
  'lib/**/*.rb'
8
8
  -
9
- CHANGELOG.md
10
9
  LICENSE
@@ -1,7 +1,52 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [1.3.8] - 2020-05-DD (Unreleased)
4
+ ## [1.3.13] - 2020-05-29
5
+
6
+ ### Added
7
+ ### Changed
8
+ ### Fixed
9
+ - `Eco::API::Organization::TagTree#tag?` to accept `nil` by returning `false`
10
+ - `Eco::API::Common::People::DefaultParsers::DateParser` will parse to `Date` class
11
+ * it was parsing to `Time` class, while the native gem `ecoportal-api` parses as `Date` ([reference](https://gitlab.com/ecoPortal/ecoportal-api/-/blob/master/lib/ecoportal/api/v1/schema_field.rb))
12
+ ## [1.3.11] - 2020-05-19
13
+
14
+ ### Added
15
+ ### Changed
16
+ - stop using `email` as `external_id` on `People#person` & `People#find`
17
+ * this should result in more accurate searches when using `:strict` options
18
+ ### Fixed
19
+
20
+
21
+ ## [1.3.11] - 2020-05-12
22
+
23
+ ### Added
24
+ ### Changed
25
+ - remove popping up comments on `Eco::API::Organization::PolicyGroups#`
26
+ ### Fixed
27
+
28
+
29
+ ## [1.3.10] - 2020-05-12
30
+
31
+ ### Added
32
+ - `Eco::API::Organization::PolicyGroups#to_name` added support for `Array` input
33
+ - `config.people.default_usergroup`, when defined, will have effect on usecases: `update` (this case was missing the change)
34
+ * on account creation, if the input file did not specify `policy_group_ids`
35
+
36
+ ### Changed
37
+ ### Fixed
38
+ - `upsert`, `hris` and `create` usecases: fixed condition for use of default_usergroup
39
+
40
+ ## [1.3.9] - 2020-05-12
41
+
42
+ ### Added
43
+ ### Changed
44
+ ### Fixed
45
+
46
+ - `usecase` callback was not receiving `usecase` paramater
47
+ * as a consequence `Batch::Job` created were missing the `usecase`
48
+
49
+ ## [1.3.8] - 2020-05-07
5
50
 
6
51
  ### Added
7
52
 
@@ -19,7 +19,7 @@ module Eco
19
19
 
20
20
  def parse_date(value)
21
21
  begin
22
- (value.to_s.empty?) ? nil : Time.parse(value)
22
+ (value.to_s.empty?) ? nil : Date.parse(value)
23
23
  rescue
24
24
  nil
25
25
  end
@@ -65,8 +65,8 @@ module Eco
65
65
  pers = candidates.first
66
66
  end
67
67
 
68
+ pers = @by_external_id[email&.downcase.strip]&.first if !pers && !email.to_s.strip.empty?
68
69
  end
69
- pers = @by_external_id[email&.downcase.strip]&.first if !pers && !email.to_s.strip.empty?
70
70
 
71
71
  pers
72
72
  end
@@ -19,7 +19,7 @@ module Eco
19
19
  def names
20
20
  @by_name.keys
21
21
  end
22
-
22
+
23
23
  def to_id(name)
24
24
  case name
25
25
  when Enumerable
@@ -32,7 +32,15 @@ module Eco
32
32
  end
33
33
 
34
34
  def to_name(id)
35
- policy_group(id)&.name
35
+ case id
36
+ when Enumerable
37
+ id.map do |n|
38
+ policy_group(n)&.name
39
+ end.compact
40
+ else
41
+ policy_group(id)&.name
42
+ end
43
+
36
44
  end
37
45
 
38
46
  def policy_group(id_name)
@@ -62,7 +62,7 @@ module Eco
62
62
  # @param key [String] tag to verify.
63
63
  # @return [Boolean]
64
64
  def tag?(key)
65
- @hash_tags.key?(key.upcase)
65
+ @hash_tags.key?(key&.upcase)
66
66
  end
67
67
 
68
68
  # Finds a subtree node.
@@ -51,7 +51,7 @@ module Eco
51
51
  unless options.dig(:exclude, :policy_groups) && !create
52
52
  end_pg_ids = person.account.policy_group_ids || []
53
53
 
54
- unless entry.policy_group_ids? && !add_account && !def_id
54
+ if add_account && def_id && !entry.policy_group_ids?
55
55
  # on account creation, if missing policy_group_ids column in the input
56
56
  # use default_usergroup, if it's defined
57
57
  end_pg_ids = [def_id]
@@ -65,7 +65,7 @@ module Eco
65
65
  unless options.dig(:exclude, :policy_groups) && !create
66
66
  end_pg_ids = person.account.policy_group_ids || []
67
67
 
68
- unless entry.policy_group_ids? && !add_account && !def_id
68
+ if add_account && def_id && !entry.policy_group_ids?
69
69
  # on account creation, if missing policy_group_ids column in the input
70
70
  # use default_usergroup, if it's defined
71
71
  end_pg_ids = [def_id]
@@ -46,11 +46,19 @@ module Eco
46
46
 
47
47
  person.account.send_invites = options[:send_invites] if options.key?(:send_invites)
48
48
 
49
- unless options.dig(:exclude, :policy_groups)
49
+ unless options.dig(:exclude, :policy_groups) && !create
50
+ end_pg_ids = person.account.policy_group_ids || []
51
+
52
+ if add_account && def_id && !entry.policy_group_ids?
53
+ # on account creation, if missing policy_group_ids column in the input
54
+ # use default_usergroup, if it's defined
55
+ end_pg_ids = [def_id]
56
+ end
57
+
50
58
  # avoid false updates by preserving the original order
51
59
  person.account.policy_group_ids = pgs.user_pg_ids(
52
60
  initial: ini_pg_ids,
53
- final: person.account.policy_group_ids
61
+ final: end_pg_ids
54
62
  )
55
63
  end
56
64
 
@@ -58,7 +58,7 @@ module Eco
58
58
  unless options.dig(:exclude, :policy_groups) && !create
59
59
  end_pg_ids = person.account.policy_group_ids || []
60
60
 
61
- unless entry.policy_group_ids? && !add_account && !def_id
61
+ if add_account && def_id && !entry.policy_group_ids?
62
62
  # on account creation, if missing policy_group_ids column in the input
63
63
  # use default_usergroup, if it's defined
64
64
  end_pg_ids = [def_id]
@@ -54,7 +54,8 @@ module Eco
54
54
  res.merge!(usecase: usecase)
55
55
  res.merge!(job: @job) if @job
56
56
  else
57
- res.push(usecase).push(@job) if @job
57
+ res.push(usecase)
58
+ res.push(@job) if @job
58
59
  end
59
60
  end
60
61
  end
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "1.3.8"
2
+ VERSION = "1.3.13"
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: 1.3.8
4
+ version: 1.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura