<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>murajun1978</author_name>
  <author_url>https://blog.hatena.ne.jp/murajun1978/</author_url>
  <blog_title>Murajun's Style</blog_title>
  <blog_url>https://murajun1978.hatenadiary.com/</blog_url>
  <categories>
    <anon>Rails</anon>
    <anon>Ruby</anon>
  </categories>
  <description>例えばこんな感じのモデル class User &lt; ActiveRecord::Base has_many :posts end class Post &lt; ActiveRecord::Base belongs_to :user scope :published, -&gt; { where(published: true) } end 公開中のPostを取得する場合はこんな感じですよね？ $ Post.published んじゃ、ユーザの公開されているPostを取得する場合は？ $ User.joins(:posts).where(posts: {published: true}) イマイチですねー…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmurajun1978.hatenadiary.com%2Fentry%2F2014%2F09%2F07%2F234009&quot; title=&quot;Railsで子テーブルのスコープを使うヘ(^o^)ノ - Murajun&amp;#39;s Style&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>2014-09-07 23:40:09</published>
  <title>Railsで子テーブルのスコープを使うヘ(^o^)ノ</title>
  <type>rich</type>
  <url>https://murajun1978.hatenadiary.com/entry/2014/09/07/234009</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
