contact_sync 0.4.2 → 0.4.3

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: ce7396763de18cc3eb8ff2f601b50646ea79d90c
4
- data.tar.gz: 5389e459d6581cdc28269846b8ec3baea5278e90
3
+ metadata.gz: c1ddea285e62aa0d36276b6d1b2bb215f1216626
4
+ data.tar.gz: acd0fc653a5ff5d483fae21374e1cbc39a2c56f7
5
5
  SHA512:
6
- metadata.gz: 1462ab6638baa8f315df0f378d8563d0bd8c551a581c2c1fcac8a9a236ee52ea6bdde4b910ddba7505a4bec40be731c46ecb5c9891f5284607b234d49b53a0f5
7
- data.tar.gz: fecc866d156c4b5ecdedba83636885dd72b46c5e88b43e09f93eae399e328395192be28654dd698a229fa9979e473ad1912ba3aefc379eb99cf178e58915a8f4
6
+ metadata.gz: 6885051417e27f82129087f90d789640f3d6e5f9bed3170fd2514150bcfc478bb3f1d9f83f0df64611970ffb7d878940086c06fb71f844e44c209968b145028b
7
+ data.tar.gz: 76c5cb60ef3b2ea7867c9f52d9794458cccfeea0aba2c5f58a2baba73d0eda23e98644582356de6b201c6b45bac44958d14c1254271a10ce9855532f0e257272
@@ -93,12 +93,12 @@ module ContactSync
93
93
  end
94
94
 
95
95
  user_phones.each do |phone|
96
- u = User.where(phone_number: phone.number.encrypt(:symmetric)).limit(1).first
97
- matched_contacts << u unless u.blank?
96
+ u = User.where(encrypted_number: phone.number.encrypt(:symmetric)).limit(1).first
97
+ matched_contacts << u.id unless u.blank?
98
98
  end
99
99
  user_emails.each do |mail|
100
- u = User.where(email: mail.email).limit(1).first
101
- matched_contacts << u unless u.blank?
100
+ u = User.where(encrypted_email: mail.email.encrypt(:symmetric)).limit(1).first
101
+ matched_contacts << u.id unless u.blank?
102
102
  end
103
103
  return matched_contacts
104
104
  end
@@ -1,3 +1,3 @@
1
1
  module ContactSync
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
@@ -11,10 +11,7 @@ class InstallContactSyncGenerator < Rails::Generators::Base
11
11
 
12
12
  def generate_migration
13
13
  migration_template "create_contact_sync_schema.rb", "db/migrate/create_contact_sync_schema.rb"
14
- end
15
-
16
- def generate_routes
17
- route(File.read(File.join(File.dirname(__FILE__), 'templates/routes.rb') ))
14
+ migration_template "change_email_encrypted_from_emails.rb", "db/migrate/change_emails_schema.rb"
18
15
  end
19
16
 
20
17
  # def generate_global_phone_db
@@ -0,0 +1,11 @@
1
+ class changeEmailSchema < ActiveRecord::Migration
2
+ def up
3
+ add_column :emails, :encrypted_email, :string
4
+ remove_column :emails, :email
5
+ end
6
+
7
+ def down
8
+ remove_column :emails, :encrypted_email
9
+ add_column :emails, :email, :string
10
+ end
11
+ 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: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saad Masood
@@ -89,6 +89,7 @@ files:
89
89
  - lib/generators/install_contact_sync/USAGE
90
90
  - lib/generators/install_contact_sync/install_contact_sync_generator.rb
91
91
  - lib/generators/install_contact_sync/templates/address.rb
92
+ - lib/generators/install_contact_sync/templates/change_email_encrypted_from_emails.rb
92
93
  - lib/generators/install_contact_sync/templates/contact.rb
93
94
  - lib/generators/install_contact_sync/templates/create_contact_sync_schema.rb
94
95
  - lib/generators/install_contact_sync/templates/email.rb