ポリモーフィック関連付けにより、一つのモデルと複数のモデルを関連付けすることができる。 例としてArticleBlockモデルに複数のモデル(Sentence, Medium, Embed)を関連付ける。 マイグレーションの作成。 class CreateArticleBlocks < ActiveRecord::Migration[5.2] def change create_table :article_blocks do |t| t.belongs_to :article t.belongs_to :blockable, polymorphic: true t.integer :leve…