I've had this too. I think I delegated it to `select_with`? Same behavior
different name. I'm wondering what the most Rails-y name would be.

On Thu, Nov 14, 2019 at 9:50 AM Max Calabrese <max.f.calabr...@gmail.com>
wrote:

> 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')
>
> *Is this a worthwhile feature? *
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-core/a6c37abb-1b91-4eea-978e-5a483c2e30a7%40googlegroups.com
> <https://groups.google.com/d/msgid/rubyonrails-core/a6c37abb-1b91-4eea-978e-5a483c2e30a7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 

Hello from Minneapolis   Josh Brody   (952) 239-7408   www
<http://www.josh.mn>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-core/CAHK71zcbcUDfhLs31Nq5qSs10vYp8Jr072JVsXRWEJh2PEMmdg%40mail.gmail.com.

Reply via email to