<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ao3</author_name>
  <author_url>https://blog.hatena.ne.jp/ao3/</author_url>
  <blog_title>趣味プログラマの外部記憶</blog_title>
  <blog_url>https://ao3-2.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>かなり離れたテーブルをhas_many しようと思考錯誤しました。 こんな感じの↓ で、 Group に属する User の Schedule を取ってくるという無謀な計画。 Schedule --*..1-&gt; User Group 普通にScheudle.find で取得するなら joins 使えばよかったんですが、will_paginate も使いたいのでそれだとめんどくさい。 ダメもとで、 class Group &lt; ActiveRecord::Base has_many :schedules, :class_name =&gt; &quot;Schedule&quot;, :joins =&gt; {:user =&gt;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fao3-2.hatenadiary.org%2Fentry%2F20080220%2F1203494285&quot; title=&quot; [rails] 無理やり ActiveRecord の has_many に joins オプションを追加する - 趣味プログラマの外部記憶&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-02-20 16:58:05</published>
  <title> [rails] 無理やり ActiveRecord の has_many に joins オプションを追加する</title>
  <type>rich</type>
  <url>https://ao3-2.hatenadiary.org/entry/20080220/1203494285</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
