phonelib 0.6.14 → 0.6.15

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: 964115d75e8eb5754a311ab68f6ac258b2c7229d
4
- data.tar.gz: 4ec38c67a691121dc9f0a4fa6a63ac285d3effc8
3
+ metadata.gz: e8d7e46eb10e0d821b842e5f88e0bb19b155a1d1
4
+ data.tar.gz: fcb0e4064fbecc3df45a001b6033620c3328fbb8
5
5
  SHA512:
6
- metadata.gz: 96f9fb2295beb53be069d89e3b117f724c582f0477a8e4d233a623c579849b6a29bcca06f9744b80ebceb3e8111e0cb0e118e3aa98fc769585df7658247661ce
7
- data.tar.gz: 4f09a4feeadd4025b72556c41e56dbcc3596fdf9302c7a01c134ac8086584c1a3f033974dd553a3f128e76f8cfdbce58ead091f96b39093a8a2dcbcae498398f
6
+ metadata.gz: c6816d97eaa931ee82e65448cd85fa91d3fb965daf3f3a1c3f62a494d70d424fc16cfa5d0e0ff59e933fd0452f040fa24cbe1ce94d7e6e396ab7afbf9b71cdd6
7
+ data.tar.gz: '049325fb4deaff9529be193175ea0df3b01b62ca083ed9cf72d6754b3350ddd7413575f5ab4c8c0a84fbfe5c430fb11e955a312513b2bb5408fd5a5823623e34'
@@ -1,4 +1,4 @@
1
1
  module Phonelib
2
2
  # @private
3
- VERSION = '0.6.14'
3
+ VERSION = '0.6.15'
4
4
  end
@@ -51,7 +51,7 @@ class PhoneValidator < ActiveModel::EachValidator
51
51
  # Validation method
52
52
  def validate_each(record, attribute, value)
53
53
  return if options[:allow_blank] && value.blank?
54
- options[:extensions] ||= true
54
+ allowed_extensions = options.has_key?(:extensions) ? options[:extensions] : true
55
55
 
56
56
  phone = parse(value, specified_country(record))
57
57
  valid = if simple_validation?
@@ -61,7 +61,7 @@ class PhoneValidator < ActiveModel::EachValidator
61
61
  end
62
62
 
63
63
  # We default to not-allowing extensions for fax numbers
64
- if valid && options[:extensions] === false && !phone.extension.empty?
64
+ if valid && !allowed_extensions && !phone.extension.empty?
65
65
  valid = false
66
66
  end
67
67
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phonelib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.14
4
+ version: 0.6.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vadim Senderovich