Skip to content

Conversation

sigmike
Copy link

@sigmike sigmike commented Jun 14, 2011

In a has_many association, the primary key may be a method (the doc says: "Specify the method that returns the primary key used for the association. By default this is id."). It works fine except when the association is eager loaded. In this case it uses the nonexistent attribute and loads an empty list of records.

This fix is based on 3-0-stable.

jake3030 pushed a commit to jake3030/rails that referenced this pull request Jun 28, 2011
…d associations are empty [rails#1696 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
@spastorino
Copy link
Contributor

is this an issue in 3-1-stable?

@isaacsanders
Copy link
Contributor

@piglop Is this still an issue?

@rafaelfranca
Copy link
Member

This pull request is for a not supported Rails version. I'm closing it now. Please see if this one is still can be applied in the Rails >= 3.1. If so, please open another one against the master branch.

Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants