Skip to content

Commit

Permalink
Don't remove the select values to add they back again
Browse files Browse the repository at this point in the history
Conflicts:
	activerecord/lib/active_record/relation/finder_methods.rb
  • Loading branch information
rafaelfranca committed Oct 15, 2013
1 parent 9f80937 commit ab9475b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation/finder_methods.rb
Expand Up @@ -261,7 +261,7 @@ def construct_relation_for_association_calculations
end

def construct_relation_for_association_find(join_dependency)
relation = except(:select).select(join_dependency.columns + select_values)
relation = select(join_dependency.columns)
apply_join_dependency(relation, join_dependency)
end

Expand Down

3 comments on commit ab9475b

@ehtb
Copy link
Contributor

@ehtb ehtb commented on ab9475b Oct 15, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafaelfranca I had this before too, but this test fails in mysql. Moving the select_values to the end fixes it.

@rafaelfranca
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing. I'll investigate

@ehtb
Copy link
Contributor

@ehtb ehtb commented on ab9475b Oct 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, if I remember correctly, it was because of the aliases and the way mysql interprets the query string.
Looking forward to seeing your fix.

Thanks!

Please sign in to comment.