In Rails 4, the opinion of this seemed to shift to the use of indexes. If you create a model using the "link" type, it will automatically create an index for you during the migration process.
rails g model Cat owner:references
Creates the following:
class CreateCats < ActiveRecord::Migration def change create_table :cats do |t| t.references :owner, index: true t.timestamps end end end
source share