has_many :through efficiency issue on <<

In has_many_through_association.rb:

      def <<(*records)


            @target << associate

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


Now with a patch and tests: http://dev.rubyonrails.org/ticket/8150


Applied, cheers!