Giter Site home page Giter Site logo

Comments (4)

loureirorg avatar loureirorg commented on August 23, 2024

Hi Sergio,

Are you using the 0.0.12 version? The 0.0.11 version was with a similar problem, which was corrected on 0.0.12.

Can you check with bundle show | grep city-state and put the results here?

from city-state.

svonborries avatar svonborries commented on August 23, 2024

Hello,

Yes I'm using the latest version... take a look!

bundle show | grep city-state

  • city-state (0.0.12)

from city-state.

loureirorg avatar loureirorg commented on August 23, 2024

I think that I fixed the bug. Can you run a bundle update, check if it's using the 0.0.13 version (bundle show | grep city-state) and check if the bug still exists?


What I have changed:

Although I can reproduce the bug here, I found a problem in the code that can be related with this bug:

I done this awful thing here:

@countries = @cities = @states = {}

Originally I have this code:

@countries = {}
@cities = {}
@states = {}

and I had refactored it in order to shrunk the code, but what I really should have done was:

@countries, @states, @cities = [{}, {}, {}]

Just for curiosity, @countries = @cities = @states = {} will create aliases between these 3 variables. So if you change one of them, you change the rest of them.

> a = b = {}
> a
{}
> a[:a] = 1
> b
{:a=>1}

from city-state.

svonborries avatar svonborries commented on August 23, 2024

Hello,
Now is working quite good!
Take a look...

2.1.1 :008 > CS.get :bo
=> {:B=>"El Beni", :C=>"Departamento de Cochabamba", :H=>"Departamento de Chuquisaca", :L=>"Departamento de La Paz", :N=>"Departamento de Pando", :O=>"Oruro", :P=>"Departamento de Potosi", :S=>"Departamento de Santa Cruz", :T=>"Departamento de Tarija"}
2.1.1 :009 > CS.get :bo, :s
=> ["Anillo", "Aroma", "Cotoca", "Santa Cruz"]
2.1.1 :010 >

At least in my development enviroment it's great!

Thank you very much,

Ser...

from city-state.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.