contact_sync 1.2.2 → 1.3.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: 26d68d12a21bf1a35d0c0e9f7992b93555b86af8
4
- data.tar.gz: e43cd2f1ceecce72e477a2c03d97735a12e6a674
3
+ metadata.gz: 8dadaea4599c076a2b99da7bda45f1a316f819ce
4
+ data.tar.gz: 24c07d9d43befd1bb739af451c81cf2fb3e36cf7
5
5
  SHA512:
6
- metadata.gz: b2b09f6a4d89b9040fb4fadcb86139e31b82741ae116aed519453822486ffe8b968c8af37f9a92684d70f86ab88cfa3c741ba97e30ff9033ea503f4445f3581b
7
- data.tar.gz: 272d6f5dbdc9a3e0b3963cf06f818b1f8c5dcff5212a6077134c5cca5ee50af9aa4897866fff7948c3d8a807d88b1a8ba040eae43ff463d06cbc0dba9c551334
6
+ metadata.gz: 0d290c1e3d9b5c467d960291a7f91e30723545ca8b768605bde389941056ed6a89638b86740a7343f641e125158dbdfb61eda0f9234df7cd628d67336a08ded8
7
+ data.tar.gz: 4ba78ab4b61d6f3b493ea3defa22de89ef726bb3d2fd077303a8f0b8a2f51bea65f623648098e9bb71d0c6f348caa68bdf749ffbb12c199ae1854f32dee9d066
@@ -18,9 +18,9 @@ module ContactSync
18
18
  end
19
19
  end
20
20
  def sync_contacts(contact_hash = {})
21
- result = {:new => {success:[], failed:[], duplicate: []}, modified: {success:[], failed:[]}, deleted: {success:[], failed:[]}}
21
+ result = {:new => {failed:[], duplicate: []}, modified: {failed:[]}, deleted: {failed:[]}}
22
22
  raise ArgumentError, "You need to provide contacts hash." if contact_hash.blank?
23
- raise ArgumentError, "You need to provide Device Identifier as deviceID" if contact_hash[:device_id].blank?
23
+ # raise ArgumentError, "You need to provide Device Identifier as deviceID" if contact_hash[:device_id].blank?
24
24
  ##########################################################################
25
25
  #########################Create new Contacts##############################
26
26
  if !contact_hash[:new].blank?
@@ -33,7 +33,7 @@ module ContactSync
33
33
  aContact.delete :emails
34
34
  begin
35
35
  newContact = Contact.new(contact_params(aContact))
36
- newContact.device_id = contact_hash[:device_id]
36
+ # newContact.device_id = contact_hash[:device_id]
37
37
  if phones
38
38
  phones.each do |aPhone|
39
39
  newContact.phones.build(phone_params(aPhone))
@@ -1,3 +1,3 @@
1
1
  module ContactSync
2
- VERSION = "1.2.2"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -14,6 +14,12 @@ class InstallContactSyncGenerator < Rails::Generators::Base
14
14
  if !self.class.migration_exists?('db/migrate', 'create_contact_sync_schema')
15
15
  migration_template "create_contact_sync_schema.rb", "db/migrate/create_contact_sync_schema.rb"
16
16
  end
17
+ binding.pry
18
+
19
+ if !self.class.migration_exists?('db/migrate', 'remove_device_id_from_contacts')
20
+ migration_template "remove_device_id_from_contacts.rb", "db/migrate/remove_device_id_from_contacts.rb"
21
+ end
22
+
17
23
  end
18
24
 
19
25
  def generate_encrypted_strings_config
@@ -65,6 +65,6 @@ class CreateContactSyncSchema < ActiveRecord::Migration
65
65
  end
66
66
 
67
67
  def down
68
-
68
+
69
69
  end
70
70
  end
@@ -0,0 +1,7 @@
1
+ class RemoveDeviceIdFromContacts < ActiveRecord::Migration
2
+ def change
3
+ remove_column :contacts, :device_id, :string, default: ""
4
+ remove_index :contacts, name: "unique_device_contact"
5
+ add_index :contacts, [:user_id, :record_id]
6
+ end
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contact_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saad Masood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2015-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -121,6 +121,7 @@ files:
121
121
  - lib/generators/install_contact_sync/templates/create_contact_sync_schema.rb
122
122
  - lib/generators/install_contact_sync/templates/email.rb
123
123
  - lib/generators/install_contact_sync/templates/phone.rb
124
+ - lib/generators/install_contact_sync/templates/remove_device_id_from_contacts.rb
124
125
  - lib/generators/install_contact_sync/templates/routes.rb
125
126
  - lib/generators/install_contact_sync/templates/user.rb
126
127
  - lib/tasks/con_sync_tasks.rake