<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>patorash</author_name>
  <author_url>https://blog.hatena.ne.jp/patorash/</author_url>
  <blog_title>patorashのブログ</blog_title>
  <blog_url>https://patorash.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby on Rails</anon>
    <anon>Ruby</anon>
  </categories>
  <description>小ネタです。migrationの際にテーブルコメントを追加する情報は検索すればいくらでもヒットするんですが、ActiveRecordでテーブルコメントを参照する方法はなかなかヒットしなかったので、メモしときます。 環境情報 Rails 6.1.6.1 Ruby 3.1.2 方法 ヒットしたのはAPI Dockのこれ。 apidock.com ConnectionAdaptersのメソッドです。引数にテーブル名を渡します。 モデルから直で取れるメソッドはなさそうでした。 connection = ApplicationRecord::connection connection.table_com…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpatorash.hatenablog.com%2Fentry%2F2022%2F07%2F28%2F091541&quot; title=&quot;ActiveRecordでテーブルコメントを参照する - patorashのブログ&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>2022-07-28 09:15:41</published>
  <title>ActiveRecordでテーブルコメントを参照する</title>
  <type>rich</type>
  <url>https://patorash.hatenablog.com/entry/2022/07/28/091541</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
