Permalink
Browse files

Don't remove the select values to add they back again

Conflicts:
	activerecord/lib/active_record/relation/finder_methods.rb
  • Loading branch information...
1 parent 9f80937 commit ab9475bccf1107919a255be3f5f7363f189e3621 @rafaelfranca rafaelfranca committed Oct 15, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation/finder_methods.rb
@@ -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

3 comments on commit ab9475b

Contributor

ehtb replied Oct 15, 2013

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

Owner

rafaelfranca replied Oct 16, 2013

Thank you for pointing. I'll investigate

Contributor

ehtb replied Oct 16, 2013

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.