Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phone.detect_country doesn’t work unless Country.load is called first #26

Closed
codyrobbins opened this issue May 16, 2012 · 3 comments
Closed

Comments

@codyrobbins
Copy link

Doesn’t work

The minimal test case

Phoner::Phone.detect_country('+1-212-555-1234’)

produces

NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.each_pair
    from /Users/Test/.rvm/gems/ruby-1.8.7-p352/gems/phone-1.1/lib/phone.rb:125:in `detect_country'
    from (irb):1
    from :0

Works

On the other hand, running

Phoner::Country.load
Phoner::Phone.detect_country('+1-212-555-1234’)

correctly produces

#<struct Phoner::Country name="United States", country_code="1", char_2_code="1", char_3_code="US", area_code=nil>
@g1smd
Copy link

g1smd commented Nov 12, 2012

The repo owner is AWOL. Your issue has already been ignored for 6 months.

Try the wmoxam/phone branch instead. The code there is much more actively maintained.

@elskwid
Copy link
Collaborator

elskwid commented May 9, 2013

I'm going to be making a pass through issues soon. See #41.

@mattclar
Copy link

I have a similar problem but with Phoner::Country.find_by_country_isocode the same fix fixed it though which is great!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants