eco-helpers 0.6.8 → 0.6.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eco/api/usecases/default_cases/to_csv_case.rb +18 -1
- data/lib/eco/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4077d63348b8ec7af402d3d9a410392eda90aad
|
4
|
+
data.tar.gz: 9be53c478c67b022e12e55cc77acca57c592a52e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63beb34156723095b8c3c1a72acf28608f35467defac8f2e97a1c3a7cd97ce9d9e6dec66d60128168544ecc964582fca4c153d944e3d316af96df6659810002e
|
7
|
+
data.tar.gz: 64f63702ae2330a7ebe7a1a7aa67579c513c56ccf35a4de03019bfca89119345f4639d3625bf1a891d95de563765631959cfed8609efd1a4a4c874b3cc8845e3
|
@@ -20,7 +20,24 @@ module Eco
|
|
20
20
|
CSV.open(file, "w") do |csv|
|
21
21
|
deps = {"supervisor_id" => {people: people}}
|
22
22
|
entry = session.new_entry(people.first, dependencies: deps)
|
23
|
-
|
23
|
+
header = entry.to_hash.keys
|
24
|
+
|
25
|
+
if options.dig(:nice_header)
|
26
|
+
name_maps = session.schema.fields_by_alt_id.transform_values do |fld|
|
27
|
+
fld.name
|
28
|
+
end.merge({
|
29
|
+
"policy_group_ids" => "User Group(s)",
|
30
|
+
"email" => "Email",
|
31
|
+
"name" => "Name",
|
32
|
+
"supervisor_id" => "Manager ID",
|
33
|
+
"filter_tags" => "Locations",
|
34
|
+
"default_tag" => "Default Location",
|
35
|
+
"id" => "ecoPortal ID"
|
36
|
+
})
|
37
|
+
header = header.map {|name| name_maps[name] ? name_maps[name] : name}
|
38
|
+
end
|
39
|
+
|
40
|
+
csv << header
|
24
41
|
people.each do |person|
|
25
42
|
csv << session.new_entry(person, dependencies: deps).to_hash.values
|
26
43
|
end
|
data/lib/eco/version.rb
CHANGED