ae_users_migrator 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ae_users_migrator}
8
- s.version = "1.0.1"
8
+ s.version = "1.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nat Budin"]
@@ -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
- Role.new(role_record["role"])
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
- p = Person.new(item["person"])
88
- df.people[p.id] = p
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: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nat Budin