<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>osyo-manga</author_name>
  <author_url>https://blog.hatena.ne.jp/osyo-manga/</author_url>
  <blog_title>Secret Garden(Instrumental)</blog_title>
  <blog_url>https://secret-garden.hatenablog.com/</blog_url>
  <categories>
    <anon>Rails</anon>
    <anon>ActiveRecord</anon>
  </categories>
  <description>久々ですこんにちは。 毎日ブログを書くとはなんだったのか…。 そろそろアウトプットしたいな〜〜〜と思い始めてきたのでぼちぼち書いていきたい…。 unscoped を使うことで default_scope を取り除くことができる さて、皆さん大好き default_scope ですが、モデルで default_scope を定義すると次のように暗黙的にクエリが追加されます。 class User &lt; ActiveRecord::Base default_scope { order(:updated_at) } end # 暗黙的に ORDER BY のクエリが追加れる puts User.all…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsecret-garden.hatenablog.com%2Fentry%2F2020%2F03%2F18%2F194551&quot; title=&quot;ActiveRecord で unscoped を呼ぶとその前のクエリが消える - Secret Garden(Instrumental)&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>2020-03-18 19:45:51</published>
  <title>ActiveRecord で unscoped を呼ぶとその前のクエリが消える</title>
  <type>rich</type>
  <url>https://secret-garden.hatenablog.com/entry/2020/03/18/194551</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
