In the future will Active Record delete the child records in an association when the parents are deleted? Certainly one can add code in the controller or the database to take care of avoiding orphans but it really seems like it should be part of the framework. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
well... it is built in. class User < ActiveRecord::Base has_many :projects, :dependent => :destroy end See ActiveRecord::Associations docs for more. On Wed, Jul 9, 2008 at 11:07 AM, Jorg Lueke <jlueke_2000-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> > In the future will Active Record delete the child records in an > association when the parents are deleted? Certainly one can add code > in the controller or the database to take care of avoiding orphans but > it really seems like it should be part of the framework. > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ahh thanks. There''s too much information in the api when you''re not sure what you''re looking for. On Jul 9, 11:17 am, "Brian Hogan" <bpho...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> well... it is built in. > > class User < ActiveRecord::Base > has_many :projects, :dependent => :destroy > end > > See ActiveRecord::Associations docs for more. > > > > On Wed, Jul 9, 2008 at 11:07 AM, Jorg Lueke <jlueke_2...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote: > > > In the future will Active Record delete the child records in an > > association when the parents are deleted? Certainly one can add code > > in the controller or the database to take care of avoiding orphans but > > it really seems like it should be part of the framework.- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---