我有以下型号 -
class Employee < ActiveRecord::Base
has_and_belongs_to_many :surveys, join_table: 'employee_surveys'
end
class Survey < ActiveRecord::Base
has_and_belongs_to_many :employees, join_table: 'employee_surveys'
end
当我这样做时Employee.first.surveys.create(name: "New Survey")
,它会产生一个错误,抱怨employee_id
是null
??