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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7e2632d78edc304ce55bb522d0d22c4c451bdb2
4
- data.tar.gz: 355afb2bf1de22cd0360d43cb1bb05b791b6f92c
3
+ metadata.gz: be45d26ae9c5af1595e938e66164a3b35e47ee9f
4
+ data.tar.gz: 0ff03beb8c8a26f236be59fdf293a20061a913b3
5
5
  SHA512:
6
- metadata.gz: 274c01fa9040a347f8caf9049113a24ddb3e1759aaef69ae1e5907a558687c55d1ebed971d597225f8081c52e555d0a3e6cc2ec109e16083e8ab8d345134439d
7
- data.tar.gz: 1558c175e9d32c92f041830ee8eaaf0f542d65eda367c7cf6930635c78efa7c37542cacbbbf289d8817c98cea95a3fa6288e3f50a86585fd53c8c77f2208a534
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
- binding.pry
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 {matched_users: matched_users, other_contacts: other_contacts}
110
+ return matched_contacts
117
111
  end
118
112
 
119
113
  # def matched_contacts
@@ -1,3 +1,3 @@
1
1
  module ContactSync
2
- VERSION = "1.1.2"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contact_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saad Masood