标签: ruby-on-rails activerecord
我希望Rails Active Record查询以防下面的SQL查询
感谢任何帮助
SELECT parent_id FROM categories INNER JOIN categories_coaches ON categories.id = categories_coaches.category_id
答案 0 :(得分:1)
Category.select(:parent_id).joins(:category_coaches)