One little pet peeve of mine is that there is no way (afaik) to just add additional columns to the select clause of a query. Like for example if I’m joining and want a count or aggregate off the join table:
User.joins(:answers)
.select(‘users.*’,‘AVG(answers.score) AS average_score’)
``
What I would really want to do is just add this to the existing select values of the scope:
User.joins(:answers)
.select_also(‘AVG(answers.score) AS average_score’)
I think it might be sensible to convert .select(“users.*, sum(baz))” to the expanded form on the ruby side using the column cache. That way you get the functionality you want without introducing a new API.