contact_sync 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/contact_sync/syncable.rb +4 -10
- data/lib/contact_sync/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: be45d26ae9c5af1595e938e66164a3b35e47ee9f
|
4
|
+
data.tar.gz: 0ff03beb8c8a26f236be59fdf293a20061a913b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5835c45cbec2d54e72789ae0cc3fa7be12d4f8c5223425dc669467eaeef0343b45165098e29933717f3139adf8bb46cb59a9a2d513f3933369f24ac5f2c80b0
|
7
|
+
data.tar.gz: bde6d6b7a816bccf2aedbd79e718907e0e35b00a9a0dab8327c9d1a1bb51bb6a2059b26877228f77243e976a13820f6e6c605bf130a0363a5324698e4eb6f0da
|
@@ -87,33 +87,27 @@ module ContactSync
|
|
87
87
|
def matched_contacts
|
88
88
|
matched_users = []
|
89
89
|
other_contacts = []
|
90
|
-
|
91
|
-
self.contacts.includes([:emails, :phones]) do |aKon|
|
90
|
+
self.contacts.includes([:emails, :phones]).each do |aKon|
|
92
91
|
#Check Phones to Match existing users.
|
92
|
+
matches = false
|
93
93
|
aKon.phones.each do |ph|
|
94
|
-
matches = false
|
95
|
-
binding.pry
|
96
94
|
u = User.where(encrypted_number: ph.number.encrypt(:symmetric)).limit(1).first
|
97
95
|
if !u.blank?
|
98
96
|
matches = true
|
99
|
-
binding.pry
|
100
97
|
matched_users << {user: u.id, phone: ph.id, contact: aKon.id}
|
101
98
|
end
|
102
99
|
end
|
103
100
|
#Check Emails to Match existing users.
|
104
101
|
aKon.emails.each do |em|
|
105
|
-
|
106
|
-
u = User.where(email: mail.email).limit(1).first
|
102
|
+
u = User.where(email: em.email).limit(1).first
|
107
103
|
if !u.blank?
|
108
|
-
binding.pry
|
109
104
|
matches = true
|
110
105
|
matched_users << {user: u.id, email: em.id, contact: aKon.id}
|
111
106
|
end
|
112
107
|
end
|
113
|
-
binding.pry
|
114
108
|
other_contacts << aKon if !matches
|
115
109
|
end
|
116
|
-
return
|
110
|
+
return matched_contacts
|
117
111
|
end
|
118
112
|
|
119
113
|
# def matched_contacts
|
data/lib/contact_sync/version.rb
CHANGED