> It's not hard to add this to association collection either. I don't > think this approach can be taking any further and it does mean that > you can't Marshal.dump what you get out of a find (not sure how much > of an issue this is but there are tests around that area).
I'd definitely prefer to use a class we defined rather than the metaclass approach, but this is the kind of thing you'll need to do. > I may just be being prematurely paranoid but if find returns a result > set object and if the objects in that collection know the result set > object (so that for example accessing an association can preemptively > load that association for all of them) would you not have the problem > that ruby would hold onto the entire result set as long as anyone was > holding onto any single object in that collection ? No you're not being paranoid, if the objects can reach their collection (and the have to be able to) then the whole collection will stay in memory while any instance is. ORMs which use this approach and have large user bases typically have things like the notion of a 'detached' object. In this case user's would have to detach those objects. Or you could hold the association to the collection in a WeakRef, but I'm not sure how well tested or widely used that class is right now... There could be some other approach I'm forgetting, but it seems to me it's a restriction you'd have to keep in mind. > Fred > > > > -- 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 [email protected] 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 -~----------~----~----~----~------~----~------~--~---
