<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>karlley_jp</author_name>
  <author_url>https://blog.hatena.ne.jp/karlley_jp/</author_url>
  <blog_title>時々とおまわり</blog_title>
  <blog_url>https://karlley.hatenablog.jp/</blog_url>
  <categories>
    <anon>Rails</anon>
  </categories>
  <description>ポリモーフィックとは 1つのモデルが他の複数のモデルに属していることを、1つの関連付けだけで表現できます。 一つのモデルを同じインターフェースを持ったものが扱う（ダックタイピングする） ポリモーフィックとは1つのモデルで関連付いた複数のモデルの処理を共通化することです。 実装例 例) 本(Book)、日報(Report)からコメント(Comment)を作成する 親モデル Book has_many :comments Report has_many :comments 子モデル Comment belongs_to :book &lt;- ポリモーフィックで共通化 belongs_to :repor…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkarlley.hatenablog.jp%2Fentry%2F2023%2F12%2F07%2F101049&quot; title=&quot;Railsのポリモーフィック関連付けについて - 時々とおまわり&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>2023-12-07 10:10:49</published>
  <title>Railsのポリモーフィック関連付けについて</title>
  <type>rich</type>
  <url>https://karlley.hatenablog.jp/entry/2023/12/07/101049</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
