-
Notifications
You must be signed in to change notification settings - Fork 198
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
Removes DEPRECATION WARNING: find_by_name #195
Conversation
Replace find_by_name with find_by_unofficial_names per recommendation from gem Countries version 5.x
Thanks for this! It looks good to me. I'll try to push a new gem within the next 24 hours. |
👋 I'm a maintainer of the That being said, |
@scudco Did you see the comment above, do you want me to make this change, or do you do it before generating a new version of the gem? |
@pmor I did look at this and explored the find methods in For reference ISO3166::Country.find_by_iso_short_name('United Kingdom') # => nil
ISO3166::Country.find_by_iso_short_name('United Kingdom of Great Britain and Northern Ireland') # => ["GB", ...]
ISO3166::Country.find_by_iso_long_name('The United Kingdom of Great Britain and Northern Ireland') # => ["GB", ...]
ISO3166::Country.find_by_unofficial_names('United Kingdom') #=> ["GB", ...] |
@filipemendespi can you post the invocation of |
@scudco We use simple_form within our project and the only configuration we have for the country is this: config.country_priority = %w[Canada] When I uncomment the line above the warnings stops passing, do you have any temporary solution for this? And in the forms we use it like this: <%= simple_form_for User.new, url: root_url do |f| %>
<%= f.input :country %>
<% end %>
|
Try this instead: config.country_priority = %w[CA] |
Yes that solves the problem! Sorry, but the change seemed clear and I didn't pay attention! Thanks! |
@pmor just checking I read understand this correctly– |
For future reference, here's some documentation in |
@filipemendespi do you still receive deprecation warnings after upgrading to country_select 6.1.1? |
@scudco Almost. Probably I'll add something that does what |
@scudco No, the test I did at @pmor suggestion was version 6.1.0 and it solved the problem. |
Hi, I'd like to thank the gem contributors for keeping the gem up to date.
I'm making this small change because when running tests in my application, I'm getting several deprecation warnings.
This change is referenced in this section of the Countries gem: https://github.com/countries/countries/#upgrading-to-42-and-5x
message error:
Task: