発生している問題・エラーメッセージ
以下のコードにおいて、orderをなくせばn+1問題は起きないのですが、この状態ではn+1問題が起きてしまいます。
orderの使い方が間違っているのでしょうか?
該当のソースコード
ruby
1clips = User 2 .includes({ clips: { restaurant: [:restaurant_pictures, :category, { near_stations: :station }] }}) 3 .find(user_id).clips.order(:created_at)

回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/12 11:08