<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mah666hhh</author_name>
  <author_url>https://blog.hatena.ne.jp/mah666hhh/</author_url>
  <blog_title>スリ飯屋MaLankaのフリーエンジニアな日々</blog_title>
  <blog_url>https://www.malanka.org/</blog_url>
  <categories>
    <anon>技術関連</anon>
    <anon>技術関連 - Rails</anon>
  </categories>
  <description>where句でテーブル名とカラム名両方を指定し、 文字列で条件指定すれば出来ました。 Model.joins(:join対象のテーブル名).where(&quot;join対象のテーブル名.join対象のテーブルにあるカラム名 &gt;= ?&quot;, 日付) 例: ordersテーブルのorder_dateが、2020/01/20以降のUserを取得する User.joins(:orders).where(&quot;orders.order_date &gt;= ?&quot;, Date.parse('2020/01/20')) 発行されるSQL SELECT 1 AS one FROM `users` INNER JOIN `orders` ON `orders`.`user_id` = `users`.`id` WHERE (orders.order_date &gt;= '2020-01-20') LIMIT 1</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.malanka.org%2Fentry%2F2020%2F01%2F31%2F072024&quot; title=&quot;【Rails】joinしたテーブルに対し、where句で特定の日付前後（以前以降）で絞り込みしたい - スリ飯屋MaLankaのフリーエンジニアな日々&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>https://cdn-ak.f.st-hatena.com/images/fotolife/m/mah666hhh/20210516/20210516184926.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-01-31 07:20:24</published>
  <title>【Rails】joinしたテーブルに対し、where句で特定の日付前後（以前以降）で絞り込みしたい</title>
  <type>rich</type>
  <url>https://www.malanka.org/entry/2020/01/31/072024</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
