In has_many_through_association.rb:
def <<(*records)
...
load_target
...
@target << associate
end
end
end
In the interests of making the lazy loading lazier, wouldn''t it be
better to *not* load the target, and instead:
@target << associate if loaded?
When you have a lot of target records the load can be a significant
hit. Am I misunderstanding this? Is there any reason not to prefer it
this way?
Evan Weaver
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
On Mar 16, 2007, at 4:29 PM, Evan wrote:> In has_many_through_association.rb: > > def <<(*records) > ... > load_target > > ... > > @target << associate > end > end > end > > In the interests of making the lazy loading lazier, wouldn''t it be > better to *not* load the target, and instead: > > @target << associate if loaded? > > When you have a lot of target records the load can be a significant > hit. Am I misunderstanding this? Is there any reason not to prefer it > this way? > > Evan Weaver+1 -- Josh Susser http://blog.hasmanythrough.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 rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Now with a patch and tests: http://dev.rubyonrails.org/ticket/8150 Evan On Mar 16, 9:00 pm, Josh Susser <j...@hasmanythrough.com> wrote:> On Mar 16, 2007, at 4:29 PM, Evan wrote: > > > > > In has_many_through_association.rb: > > > def <<(*records) > > ... > > load_target > > > ... > > > @target << associate > > end > > end > > end > > > In the interests of making thelazyloading lazier, wouldn''t it be > > better to *not* load the target, and instead: > > > @target << associate if loaded? > > > When you have a lot of target records the load can be a significant > > hit. Am I misunderstanding this? Is there any reason not to prefer it > > this way? > > > Evan Weaver > > +1 > > -- > Josh Susserhttp://blog.hasmanythrough.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 rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
On 4/23/07, Evan <eweaver@gmail.com> wrote:> > > Now with a patch and tests: http://dev.rubyonrails.org/ticket/8150Applied, cheers! -- 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 -~----------~----~----~----~------~----~------~--~---