On Mon, Apr 26, 2010 at 7:51 AM, Vincent Bakker
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
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-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.