This project is archived and is in readonly mode.

#3146 ✓resolved
rogergl

Still a bug in association_preload.rb ?

Reported by rogergl | September 4th, 2009 @ 12:54 PM

if I specify my own primary key for belongs_to:

class Price < ActiveRecord::Base

 belongs_to article :primary_key => "produktnr"

end

and use a nested include:

class AllPrices
named_scope :all_record :include => [:price => :article] end

Preloading for article doesn't work sind the ids are taken for the select and not the given primary key.

I think there is a bug on line 324 of association_preload. I think it should honour the primary key given in the belongs_to statement.

Regards
Roger

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages