2 models -> 1 model and class with array

Hello,

I need a solution for my question - i have 2 models, for example
person and city. model city will have 3 records every time(for example
London, Berlin, Madrid). Actually i used belongs_to, has_many between
this models and it’s fine, but all the times it run’s SQL to gel list
of cities. I want to use only one model person and create some class
that will contain this 3 records and when i will create a new person i
can choose from select box a city.

Thanks

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs