big-phoney 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{big-phoney}
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Pat Nakajima", "Brandon Keene"]
@@ -21,7 +21,8 @@ module BigPhoney
21
21
  record.errors[attribute] << "must be a valid US phone number"
22
22
  end
23
23
 
24
- if number and not BigPhoney::PhoneNumber.new(number, :country_code => record.try(:country_code)).valid?
24
+ country_code = record.respond_to?(:country_code) && record.country_code
25
+ if number and not BigPhoney::PhoneNumber.new(number, :country_code => country_code).valid?
25
26
  if record.errors[attribute].empty?
26
27
  record.errors[attribute] << "is not valid"
27
28
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: big-phoney
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pat Nakajima