0063nobodyさん垢版 | 栗砲2019/03/10(日) 21:21:31.76ID:??? 子レコードの数を条件に親レコードを抽出する http://o.inchiki.jp/obbr/274 子を、1つ以上持つ親 Parent.where(id: Children.select(:parent_id). group(:parent_id).having("count(parent_id) >= ?", 1) );