From 683ad0b471c968800a9cbe805eac6199c948a806 Mon Sep 17 00:00:00 2001 From: Steve Lounsbury Date: Sun, 1 Mar 2015 14:06:38 -0500 Subject: [PATCH] Indexing a polymorphic assoc adds index on type and id [ci skip] --- guides/source/association_basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index d6b2e75e1e..52e154ad18 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -460,7 +460,7 @@ class CreatePictures < ActiveRecord::Migration t.timestamps null: false end - add_index :pictures, :imageable_id + add_index :pictures, [:imageable_id, :imageable_type] end end ```