3.1 ActiveRecord regression: habtm doesn't respect select options anymore #2923

Closed
joevandyk opened this Issue Sep 7, 2011 · 3 comments

Comments

Projects
None yet
3 participants
@joevandyk
Contributor

joevandyk commented Sep 7, 2011

Failing test here: joevandyk/rails@a6bb340

This worked fine in 3.0, stopped working in 3.1.

Developer.first.projects.select('id').to_sql

SELECT "projects".*, id FROM "projects" INNER JOIN "developers_projects" ON "projects"."id" = "developers_projects"."project_id" WHERE "developers_projects"."developer_id" = 1

Note that SELECT "projects".*, id isn't correct.

@tenderlove

This comment has been minimized.

Show comment Hide comment
@tenderlove

tenderlove Sep 7, 2011

Owner

Can you post your schema.rb and the relationships in your Developer and Project model?

Owner

tenderlove commented Sep 7, 2011

Can you post your schema.rb and the relationships in your Developer and Project model?

@joevandyk

This comment has been minimized.

Show comment Hide comment
@joevandyk

joevandyk Sep 7, 2011

Contributor

I'm using what's in the habtm rails unit tests. Developers habtm Projects.

Contributor

joevandyk commented Sep 7, 2011

I'm using what's in the habtm rails unit tests. Developers habtm Projects.

htanata added a commit to htanata/rails that referenced this issue Sep 15, 2011

@jonleighton

This comment has been minimized.

Show comment Hide comment
@jonleighton

jonleighton Sep 26, 2011

Member

This is fixed by #3030 which I've just merged.

Member

jonleighton commented Sep 26, 2011

This is fixed by #3030 which I've just merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment