heartcombo / simple_form

Forms made easy for Rails! It's tied to a simple DSL, with no opinion on markup.
http://blog.plataformatec.com.br/tag/simple_form
MIT License
8.21k stars 1.31k forks source link

Pin country_select version in README #1833

Closed DanielPechersky closed 6 months ago

DanielPechersky commented 6 months ago

The latest release of Simple Form breaks with country_select 9.0.0

carlosantoniodasilva commented 6 months ago

Can you show what the error or incompatibility is? I'd rather try to fix that, find a way to work with all versions, if we can, but first I need to understand more. Thanks!

DanielPechersky commented 6 months ago

I'll get you more information on the error, but you should pin the version of country_select anyways. Otherwise the user's code will break in this circumstance:

  1. A user copy pastes gem 'country_select' from your README
  2. country_select publishes a new major version
  3. The user updates all their gems, and country_select is no longer compatible with Simple Form
carlosantoniodasilva commented 6 months ago

I appreciate the feedback. How users decide to define the gem on their gemfiles is probably not a big concern we should have though, some prefer to pin, others prefer to leave it open, in any case bundle updating multiple gems is generally not advised.

There's also the concern of it becoming an extra small burden to be updating the readme every time with new country_select versions ourselves. Plus, we wouldn't get these helpful reports when it breaks. :)

DanielPechersky commented 6 months ago

This seems to be the relevant information:

#<ArgumentError: wrong number of arguments (given 4, expected 1..3)>

/Users/dannyp/.rbenv/versions/3.2.2/gemsets/foo/gems/country_select-9.0.0/lib/country_select/country_select_helper.rb:6:in `country_select'
/Users/dannyp/.rbenv/versions/3.2.2/gemsets/foo/gems/formtastic-5.0.0/lib/formtastic/inputs/country_input.rb:77:in `block in to_html'
carlosantoniodasilva commented 6 months ago

I ran the tests with a full bundle update here, which used country_select v9.0.0, and didn't run into any errors other than the fact that they dropped support to Ruby 2.7 already apparently (as did some other gems).

carlosantoniodasilva commented 6 months ago

@DanielPechersky it looks like you're using formtastic instead, which has a PR to add support to country_select v9.0.0.

Let me know if you run into anything with SimpleForm.

DanielPechersky commented 6 months ago

Ah, looks like this is the fabled "user error". Apologies

carlosantoniodasilva commented 6 months ago

No worries, glad I could help. 👍