You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let flight = new Flight({... });
let instruction = new Instruction({...});
and I just want to save them all together.
Do I have to do it all manually, ie :
save the Flight
set the flightId in the instruction
save the instruction
all of it with a transaction being cast from call to call ?
or can I just set the value of the relation with flight.set('instructions', [instruction]) ? flight.instructions().attach(instruction) ?
and save it all ?
It seems quite confusing that basic relationship handling doesn't seem to be covered, is that's the case.
Any hint highly appreciated,
many thanks
The text was updated successfully, but these errors were encountered:
I'm looking for the nicest/recommanded way to save an object and its relations at the same time, and within a transaction.
Let's say I have Flight Model having 0..N relations Instructions.
Now i'm building a Model with all fields :
and I just want to save them all together.
Do I have to do it all manually, ie :
all of it with a transaction being cast from call to call ?
or can I just set the value of the relation with
flight.set('instructions', [instruction])
?flight.instructions().attach(instruction)
?and save it all ?
It seems quite confusing that basic relationship handling doesn't seem to be covered, is that's the case.
Any hint highly appreciated,
many thanks
The text was updated successfully, but these errors were encountered: