ActiveModel::UnknownAttributeError: unknown attribute when seeding belongs_to relationship
问题 Trying to seed a has_many/belongs_to relationship. A user has_many scripts, a script belongs_to a user. When seeding the script, I get this error: ActiveModel::UnknownAttributeError: unknown attribute 'user_id' for Script. I'd think that this line in my migration would create a user_id attribute for script? t.belongs_to :user, index: true, foreign_key: true app/models/script.rb class Script < ApplicationRecord belongs_to :user has_many :commits has_many :script_users, through: :commits,