Add more documentation for #pluck method usage (multiple tables)


I noticed using the Active Record #pluck method you are not limited to selecting multiple fields from a single table but also from multiple tables. In fact, you can do more than “selecting” multiple fields from multiple tables.

User.distinct.joins(categories, :comments: :likes).pluck(“users.first_name || ’ ’ || users.last_name,, comments.ttitle, likes.do_not_like”)

I spent a lot of time pulling my hair wondering how to select multiple fields from multiple tables in the most efficient way and ended up doing a lot of research in the internet and the source code. I suggest adding this to the Rails Query Interface documentation on #pluck method to save other people’s time.


Thanks, I have created an issue for this