ae_users_migrator 1.0.1 → 1.0.2
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.
- data/VERSION +1 -1
- data/ae_users_migrator.gemspec +1 -1
- data/lib/ae_users_migrator/import.rb +11 -7
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.2
|
data/ae_users_migrator.gemspec
CHANGED
@@ -46,19 +46,20 @@ module AeUsersMigrator
|
|
46
46
|
|
47
47
|
def initialize(json)
|
48
48
|
@email_addresses = json["email_addresses"].collect do |ea_record|
|
49
|
-
EmailAddress.new(ea_record["email_address"])
|
49
|
+
EmailAddress.new(ea_record["email_address"] || ea_record)
|
50
50
|
end
|
51
51
|
|
52
52
|
@open_id_identities = json["open_id_identities"].collect do |oid_record|
|
53
|
-
OpenIdIdentity.new(oid_record["open_id_identity"])
|
53
|
+
OpenIdIdentity.new(oid_record["open_id_identity"] || oid_record)
|
54
54
|
end
|
55
55
|
|
56
56
|
@roles = json["roles"].collect do |role_record|
|
57
|
-
|
57
|
+
rr =
|
58
|
+
Role.new(role_record["role"] || role_record)
|
58
59
|
end
|
59
60
|
|
60
61
|
if json["account"]
|
61
|
-
@account = Account.new(json["account"]["account"])
|
62
|
+
@account = Account.new(json["account"]["account"] || json["account"])
|
62
63
|
end
|
63
64
|
|
64
65
|
%w{nickname birthdate gender id firstname lastname phone best_call_time}.each do |f|
|
@@ -83,10 +84,13 @@ module AeUsersMigrator
|
|
83
84
|
df = Dumpfile.new
|
84
85
|
|
85
86
|
json.each do |item|
|
86
|
-
if item["person"]
|
87
|
-
|
88
|
-
|
87
|
+
p = if item["person"]
|
88
|
+
Person.new(item["person"])
|
89
|
+
else
|
90
|
+
Person.new(item)
|
89
91
|
end
|
92
|
+
|
93
|
+
df.people[p.id] = p
|
90
94
|
end
|
91
95
|
|
92
96
|
return df
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ae_users_migrator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 2
|
10
|
+
version: 1.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nat Budin
|