Hi guys,
I have a table that has a country column (:string). Now I need to group
together all the countries that are in Europe.
Any ideas on how I would approach this? (quickfix wise)
Regards,
Vincent
Hi guys,
I have a table that has a country column (:string). Now I need to group
together all the countries that are in Europe.
Any ideas on how I would approach this? (quickfix wise)
Regards,
Vincent
On Mon, Apr 26, 2010 at 7:51 AM, Vincent B. [email protected]
wrote:
I have a table that has a country column (:string). Now I need to group
together all the countries that are in Europe.Any ideas on how I would approach this? (quickfix wise)
Add continent as an attribute to Country, access collections via
named scope
Create a Continent model where Continent has_many countries,
Country belongs_to continent
Hassan S. ------------------------ [email protected]
twitter: @hassan
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs