Comment Comment by nicolasMLV Rails uses foreign keys by default, usually I generate a migration file with `rails generate migration AddThisToThing this:references`Then this line is generated `add_reference :things, :this, foreign_key: true`and then we call the migration, and there is the foreign key. parent nicolasMLV 8 years ago
Then this line is generated `add_reference :things, :this, foreign_key: true`
and then we call the migration, and there is the foreign key.