Hey Pete, Looks like a good patch, but I think they're already discussing the issue here:
http://dev.rubyonrails.org/ticket/7309 It certainly seems to cover some of the same ground (must admit I haven't looked into it in too much detail). Maybe check that ticket out and see if there's anything to add to it from your patch? Cheers, Chris On Jul 29, 10:46 am, Pete Yandell <[EMAIL PROTECTED]> wrote: > I've just submitted my first patch, and I'd love to get some feedback > on it. This patching Rails thing is a bit daunting if you haven't done > it before! Not sure if I'm on the right track. > > http://dev.rubyonrails.org/ticket/9129 > > >From the description: > > A has_one or has_many relationship with :dependent set either :nullify > will incorrectly destroy the associated objects when the association > is reassigned or set to nil. Instead, the associated objects' foreign > keys should be nullified, as they are when the parent object is > destroyed. > > For example, given this association: > > class Fred > has_one :george, :dependent => :nullify > end > > The following will cause george to be destroyed. > > fred = Fred.create > george = George.create(:fred_id => fred) > > fred.george = nil > > The issue also extends to :dependent => :delete and :dependent > => :delete_all. Associated objects are destroyed rather than deleted > when the association is reassigned. > > The attached patch fixes this issue and makes :dependent behaviour > consistent in all circumstances the I can think of. > > Cheers, > > Pete Yandellhttp://notahat.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---