contact_sync 1.4.5 → 1.4.6

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: 1b54c4dacf815e463877cca60e761a1aa00adf9c
4
- data.tar.gz: 003324d286aaabf009e75b9577336e3adae1e577
3
+ metadata.gz: bc9551dbfc1bc07e1292297af8f959ec5b0f9787
4
+ data.tar.gz: ba61bff7f392f4b4083a450e7ffaba57cc6b36fe
5
5
  SHA512:
6
- metadata.gz: b437815a29597fcbbe26251903ec5e6403403e46751439d30af7a98e15f6ffc535c9a1db401318462910c6455cd904124b5fd44e0928a89c08a232e8a65df549
7
- data.tar.gz: 44fbe9ae110f6f47e7bc1c7fa8c3355de74bd41d385ac1ce14c41226c71ded99e43b0ff87e3210225cf29067057a70aa906048d58a5d2c7c57f3e61549d840a6
6
+ metadata.gz: 7d302fe48e68023d8ab08e906f06c3f50410c63c68a26d3f22a3cc2a32a58bd1f5bad619bcc91528b6343e1bcc8eff4614e3c7821f4c23eb0053e3dbcbe7f775
7
+ data.tar.gz: 9156b43b574e7ec4a8b2f1bef21913041d4f3bb01a13220f8aa1d72d292d625b0d53ca3dae7169a5795f457aef6513be321dd9411f6d775dc0c8dda7cac0e044
@@ -13,6 +13,8 @@ module ContactSync
13
13
  def complete_phone_number
14
14
  if self.cc_prefix.blank?
15
15
  "00#{self.phone_number}"
16
+ elsif self.cc_prefix == "0"
17
+ "#{self.cc_prefix}#{self.phone_number}"
16
18
  else
17
19
  "+#{self.cc_prefix}#{self.phone_number}"
18
20
  end
@@ -1,3 +1,3 @@
1
1
  module ContactSync
2
- VERSION = "1.4.5"
2
+ VERSION = "1.4.6"
3
3
  end
@@ -16,6 +16,10 @@ class Phone < ActiveRecord::Base
16
16
 
17
17
  def number=(string)
18
18
  self.cc_prefix, num = string.extract_country_code
19
+ if num.blank? or num.length < 4
20
+ self.errors[:phone_number] << "Phone number is not valid"
21
+ return
22
+ end
19
23
  self.encrypted_number = num.encrypt(:symmetric)
20
24
  self.encrypted_number
21
25
  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.4.5
4
+ version: 1.4.6
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-08-28 00:00:00.000000000 Z
11
+ date: 2016-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails