{"description":"N+1\u554f\u984c\u89e3\u6c7a\u306e\u305f\u3081\u3001includes\u306e\u8a2d\u5b9a\u3092\u3057\u3066\u3044\u305f\u3002group\u304cuser\u3092\u53c2\u7167\u3057\u3066\u304a\u308a\u3001user\u304cdepartment\u3092\u53c2\u7167\u3057\u3066\u3044\u308b\u3068\u304d\u3001group\u304b\u3089department\u3092includes\u3067\u6307\u5b9a\u3059\u308b\u306e\u306b\u3061\u3087\u3063\u3068\u624b\u9593\u53d6\u3063\u305f\u3002group \u2192 user \u2192 department \u4e0b\u8a18\u306e\u3088\u3046\u306b\u66f8\u3044\u3066\u3082\u3046\u307e\u304f\u3044\u304b\u306a\u304b\u3063\u305f # @groups = Group.order(:id) @groups = Group.order(:id). includes(:user, :department) \u4e0b\u8a18\u306e\u3088\u3046\u306b\u66f8\u3044\u305f\u3089\u3046\u307e\u304f\u3044\u3063\u305f # @groups = Group.order(:id) @groups \u2026","url":"https://ayaketan.hatenablog.com/entry/2014/06/13/120000","type":"rich","author_name":"ayaketan","categories":["Ruby"],"published":"2014-06-13 12:00:00","blog_title":"ayaketan\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u65e5\u8a18","blog_url":"https://ayaketan.hatenablog.com/","width":"100%","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fayaketan.hatenablog.com%2Fentry%2F2014%2F06%2F13%2F120000\" title=\"Rails4 3\u968e\u5c64\u306eincludes\u306e\u6307\u5b9a - ayaketan\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"title":"Rails4 3\u968e\u5c64\u306eincludes\u306e\u6307\u5b9a","version":"1.0","author_url":"https://blog.hatena.ne.jp/ayaketan/","provider_url":"https://hatena.blog","height":"190"}