I have a migration class project like this
class CreateProjects < ActiveRecord::Migration def change create_table :projects do |t| t.string :title t.text :description t.boolean :public t.references :user, index: true, foreign_key: true t.timestamps null: false end end end
it creates the column name user_id in the project table, but I want to name the column owner_id, so I can use project.owner instead of project.user.
source share