У меня есть следующие модели -Rails has_and_belongs_to_many создать/вставка не работает
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
??
Что точная ошибка/трассировку? –