manage_relationship not creating many-to-many join records
I'm having trouble getting
manage_relationship
to work with a many-to-many relationship where the destination resource uses a non-standard primary key.
Setup
I have a many-to-many relationship between Device
and Pass
through a DeviceRegistration
join table:
- Device: Standard resource with uuid_primary_key :id
- Pass: Uses uuid_primary_key :serial_number
(not :id
)
- DeviceRegistration: Join table with device_id
and serial_number
fields
Resource Configurations
Device Resource
3 Replies
Pass Resource
DeviceRegistration Join Resource
The Problem
When I try to create a device with passes:
The device gets created successfully, but no join records are created in the DeviceRegistration table. When I load the relationship:
try adding debug? true and seeing what is logged
Are you sure that no join records are created? i.e
Ash.count!(JoinResource) == 0
?Thanks I solved it with debug was a silly typo in the execution flow on my side that went unnoticed!!! Thanks for being so responsive!