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

add find_country_by_name method, use downcase in find methods #4

Merged
merged 1 commit into from
Sep 16, 2011

Conversation

joecorcoran
Copy link
Contributor

Hi,

Thanks for this gem, it's really great. Just thought I'd let you know about this change I've made. I thought it was a little weird that the find_by_name method returned an array containing the country code and then a hash with all the country data. Maybe this was needed for a specific case? I would expect it to return a Country instance. Ideally I'd replace the old method, but I've added a separate find_country_by_name method to avoid getting in anyone's way.

I also downcased the search term and country name(s) in find_by_name to allow for user capitalization mistakes, as I'm pulling in location data from APIs. The usage of this method is unaffected.

I had trouble running the tests at first for some reason – I had to resort to specifying the encoding at the top of the file.

Cheers,

Joe

hexorx added a commit that referenced this pull request Sep 16, 2011
add find_country_by_name method, use downcase in find methods
@hexorx hexorx merged commit fcc3786 into countries:master Sep 16, 2011
@hexorx
Copy link
Collaborator

hexorx commented Sep 16, 2011

Thank you for contributing! There was a small bug that was causing the tests to fail but I fixed it and have pushed a new version of the gem.

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

Successfully merging this pull request may close these issues.

None yet

2 participants