<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yokoyantech</author_name>
  <author_url>https://blog.hatena.ne.jp/yokoyantech/</author_url>
  <blog_title>紙一重の積み重ね</blog_title>
  <blog_url>https://www.yokoyan.net/</blog_url>
  <categories>
    <anon>プログラミング</anon>
    <anon>Rails</anon>
    <anon>ruby</anon>
  </categories>
  <description>はじめに N+1問題を解消するために、複数の関連を持つModelをincludesメソッドで解消する方法をメモ。 実行環境 Rails5.2.0 Ransack Slim Model定義 Userに持っている名称と、Corporationに持っている名称を取得したい。 class User &lt; ApplicationRecord has_one :customer, dependent: :destroy class Customer &lt; ApplicationRecord belongs_to :user has_many :points, dependent: :destroy class…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.yokoyan.net%2Fentry%2F2018%2F10%2F29%2F175013&quot; title=&quot;【N+1問題対策】Ransackとincludesメソッドを使ってActiveRecordの多段の関連を検索する方法 #Rails5 - 紙一重の積み重ね&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/y/yokoyantech/20181029/20181029174950.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-10-29 17:50:13</published>
  <title>【N+1問題対策】Ransackとincludesメソッドを使ってActiveRecordの多段の関連を検索する方法 #Rails5</title>
  <type>rich</type>
  <url>https://www.yokoyan.net/entry/2018/10/29/175013</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
