Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use _ids method instead of pluck to embed ids #177

Merged
merged 1 commit into from Dec 21, 2012

Conversation

nragaz
Copy link
Contributor

@nragaz nragaz commented Dec 21, 2012

Sorry to do this but there was a problem with PR #176. If you use pluck to select the id column on a has_many through association, the id column won't be disambiguated. However, you can use the association_ids method instead to achieve the same effect as pluck but with disambiguation.

I think pluck should probably disambiguate the column name, but in the interim this fixes the problem. Sorry for not noticing this sooner.

@nragaz
Copy link
Contributor Author

nragaz commented Dec 21, 2012

Ah, apparently this is fixed in Rails master: rails/rails@a878126

Not much help to most users though and would cause an exception if used with >3.2 and <3.2.10.

@steveklabnik
Copy link
Contributor

🤘 let's merge this then. Thank you! ❤️

steveklabnik added a commit that referenced this pull request Dec 21, 2012
use _ids method instead of pluck to embed ids
@steveklabnik steveklabnik merged commit b5b3923 into rails-api:master Dec 21, 2012
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.

None yet

2 participants