3,765
回編集
差分
Tep8
,→company
% bin/rails generate migration add_company_reference_to_users company:references
% bin/rails generate migration add_note_reference_to_name_list note:references
nullを許可する
add_reference :users, :company, foreign_key: true
belongs_to :company, optional: true
bin/rails db:drop db:create db:migrate