<?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>Ruby</anon>
  </categories>
  <description>Ruby on Rails Advent Calendar 2019 2日目の記事になります。 今回は最近ハマっているクエリメソッド付けたり外したりしていることを簡単に書いてみようかと思います。 サンプルモデル 今回は以下のような scope を定義したモデルを例として説明していきたいと思います。 class User &lt; ActiveRecord::Base # 管理者を絞り込む scope scope :administer, -&gt; { # 以下の条件を管理者として扱う where(active: true).where.not(email: nil) } end # 管理者一覧を取得する…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsecret-garden.hatenablog.com%2Fentry%2F2019%2F12%2F02%2F001207&quot; title=&quot;【Ruby on Rails Advent Calendar 2019】ActiveRecord で後から where クエリを上書きする【2日目】 - 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>2019-12-02 00:12:07</published>
  <title>【Ruby on Rails Advent Calendar 2019】ActiveRecord で後から where クエリを上書きする【2日目】</title>
  <type>rich</type>
  <url>https://secret-garden.hatenablog.com/entry/2019/12/02/001207</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
