eco-helpers 0.9.3 → 0.9.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c80ae3aadfdbce22868e7a60c6c6a979bfcad0169fffccb47a6a412bbd7c5788
|
4
|
+
data.tar.gz: ec19d4b61fe40b33e4fc1b7ac1deba98110c901e573c4c3c421c6f28409e0b46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2732b578b4f14b62442d525ca028d11fbba6c888614a85975b3a01f4fc988e7c967b187fe7289e1a3506e56c6067d28ad40a97ecf8c5d52641d2232e504a88db
|
7
|
+
data.tar.gz: 55a0ef82cfa791f4fb7c88588a9dc90b082cc162aeb208bb22c835e2d2d4c1171ce576378e7c13bdb4e9d64632f97dd00ba1346667b3ae91198f40da6f35c7c8
|
@@ -11,6 +11,22 @@ module Ecoportal
|
|
11
11
|
original_doc["account"] = JSON.parse(doc["account"])
|
12
12
|
end
|
13
13
|
|
14
|
+
def account=(value)
|
15
|
+
case value
|
16
|
+
when NilClass
|
17
|
+
doc["account"] = nil
|
18
|
+
when Internal::Account
|
19
|
+
doc["account"] = JSON.parse(value.to_json)
|
20
|
+
when Hash
|
21
|
+
doc["account"] = value.slice(*%w[policy_group_ids landing_page_id permissions_preset permissions_custom preferences prefilter filter_tags login_provider_ids starred_ids])
|
22
|
+
else
|
23
|
+
# TODO
|
24
|
+
raise "Invalid set on account: Need nil, Account or Hash; got #{value.class}"
|
25
|
+
end
|
26
|
+
remove_instance_variable("@account") if defined?(@account)
|
27
|
+
return account
|
28
|
+
end
|
29
|
+
|
14
30
|
end
|
15
31
|
end
|
16
32
|
end
|
@@ -18,8 +18,12 @@ module Eco
|
|
18
18
|
if !person
|
19
19
|
session.logger.error("Entry(#{i}) - this person does not exist: #{entry.to_s(:identify)}")
|
20
20
|
else
|
21
|
-
unless entry.email.downcase == person.email
|
22
|
-
|
21
|
+
unless entry.email.to_s.strip.downcase == person.email
|
22
|
+
|
23
|
+
super_id = person.supervisor_id
|
24
|
+
s_account_doc = person.account&.doc
|
25
|
+
account_doc = s_account_doc ? JSON.parse(s_account_doc.to_json) : nil
|
26
|
+
|
23
27
|
person.account = nil
|
24
28
|
remove.add(person)
|
25
29
|
|
@@ -29,7 +33,10 @@ module Eco
|
|
29
33
|
end
|
30
34
|
|
31
35
|
add_account.add(person) do |person|
|
32
|
-
|
36
|
+
if account_doc
|
37
|
+
person.account = account_doc
|
38
|
+
end
|
39
|
+
person.supervisor_id = super_id
|
33
40
|
end
|
34
41
|
end
|
35
42
|
|
data/lib/eco/version.rb
CHANGED