Will do, thanks. I was curious about that as I did not want it to actually destroy the end of the chain for either of them. For example, if a county is destroyed, I did not want it to destroy cities attached to it and likewise for cities for counties. Apparently destroy therefore only interacts with the intermediary table elements?
-George On Jun 25, 9:57 pm, Matt Jones <[email protected]> wrote: > On Jun 25, 2011, at 2:40 PM, ylluminate wrote: > > > Okay, sorry about that. Inexperience with the has_many :through > > apparently... Found that I needed to have a relationship with the > > city_county model as well so that it would simply have a > > "has_many :city_counties" before each of the has_many ____, :through > > => :city_counties for both the city.rb and county.rb models. > > Yep. You may also want :dependent => :destroy on both of the plain has_manys, > so that the join table (city_countries) records are cleaned up when an > associated record is deleted. > > --Matt Jones -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
