On Mon, Apr 26, 2010 at 7:51 AM, Vincent Bakker <li...@ruby-forum.com> 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)

1) Add continent as an attribute to Country, access collections via
        named scope

2) Create a Continent model where Continent has_many countries,
       Country belongs_to continent

HTH,
-- 
Hassan Schroeder ------------------------ hassan.schroe...@gmail.com
twitter: @hassan

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to