I have a question about the behavior of the default create
action behavior.
I have a resource: Section, it has a uuid primary key and here is the relevant relationship declaration:
relationships do
belongs_to :exam, App.MCAT.Exam, allow_nil?: false, writable?: true
...
end
When I try to create a Section
using the default create action like this:
Section.create!(%{exam_id: exam.id, type: :phys, order: 1, allotted_time_seconds: 60 * 95})
I get an Invalid Input error that says: “relationship exam is required”
I feel like including the id has worked for me before, but I think that is when the id was a primary key.
Is there a way to specify this field with the default create or do I need to make a custom create that accepts exam_id
explicitly?