Prem Sichanugrist
2010-Sep-10 13:08 UTC
Should using destroy on AR association collection updates the collection in memory?
Hi, I''m currently cleaning up my ticket pool and came across one of the ticket regarding the destroyed object. One person has purposed that the destroyed object should be removed from the list, but I don''t see anymore feedback on this. What do you guys think? The ticket is this one: https://rails.lighthouseapp.com/projects/8994/tickets/3288-using-destroy-on-ar-association-collection-updates-the-collection-in-memory Thank you, Prem -- 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 rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Michael Koziarski
2010-Sep-11 06:28 UTC
Re: Should using destroy on AR association collection updates the collection in memory?
> I''m currently cleaning up my ticket pool and came across one of the ticket > regarding the destroyed object. One person has purposed that the destroyed > object should be removed from the list, but I don''t see anymore feedback on > this. What do you guys think?The patches seem to have gone AWOL, not sure if that was a lighthouse bug or if the original reporter removed them? Personally I think there are too many cases where we won''t be able to fix this for us to get too worried about handling this specific case. AR doesn''t try to provide completely transparent mapping of object graphs to relational databases so there are a tonne of cases which won''t ever be handled such as destroys happening in other processes or other threads. You can always use pirates(:reload) to force the collection to be refetched. Having said *that*, the proposed change to make the association''s own destroy method remove the item from the collection seems pretty straightforward and assuming it''s not too tricky to implement we could do that.> The ticket is this > one: https://rails.lighthouseapp.com/projects/8994/tickets/3288-using-destroy-on-ar-association-collection-updates-the-collection-in-memory > > Thank you, > > Prem > > -- > 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 > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- Cheers Koz -- 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 rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.