Skip to content

Commit

Permalink
Get country data in a more straight forward way
Browse files Browse the repository at this point in the history
  • Loading branch information
humancopy committed Jul 11, 2015
1 parent cd2afab commit 709a31b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/phony_rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
module PhonyRails

def self.country_number_for(country_code)
ISO3166::Country::Setup.data[country_code.to_s.upcase].try(:[], 'country_code')
ISO3166::Country[country_code.to_s.upcase].try(:[], 'country_code').try(:data)
end

# This method requires a country_code attribute (eg. NL) and phone_number to be set.
Expand Down

0 comments on commit 709a31b

Please sign in to comment.