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

Use << to add missing city to the list #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

duduribeiro
Copy link

Hey folks 👋

I'm using ruby 3.2.2 and having a issue when adding a missing city. I added this yml to my project:
db/cities-lookup.yml

BR:
  GO:
    "Mutunópolis": "Mutunópolis"

but when I run

CS.cities(:go, :br)

to test it fails for me because:

/Users/cadu/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/city-state-1.1.0/lib/city-state.rb:185:in `[]=': wrong number of arguments (given 1, expected 2..3) (ArgumentError)

              @cities[country][state][] = new_value

I think the idea of this line is to add a new_value to the existing array, so I changed it to include the new line

Instead of using `@cities[country][state] = new_value`, use `<<` to add the missing city into the cities list
@duduribeiro
Copy link
Author

duduribeiro commented Feb 22, 2024

hey @loureirorg 👋

Just pinging to check if this one and #68 are valids. Just wanted a bump of version so I can use this instead of a fork 😄

Thanks!

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.

1 participant