nova-attach-many icon indicating copy to clipboard operation
nova-attach-many copied to clipboard

Is there support for pivot custom fields?

Open rela589n opened this issue 3 years ago • 2 comments

rela589n avatar Jan 14 '21 04:01 rela589n

#45

nikans avatar Mar 25 '21 02:03 nikans

To document this a little further, I was looking for this as well because I needed associated records to be created with default values (JSON fields can't have default values in the DB).

I wanted my ModelA to have 3 ModelB created automatically after being created. So I setup an Observer to listen for the created call and just create them afterwards but despite being able to see them being created in the logs, seeing the DB inserts go through etc, those models were nowhere to be found, they just disappeared.

So if your associated models are disappearing, make sure that you're disabling this package from the create view because the call to the function "sync" that is done in the package will delete any other association you're manually creating. And it's a PAIN to diagnose ahah.

I wanted to write this somewhere in case anybody ended up looking for their disappearing models because I found nothing on Google (pretty logical).

le-martre avatar Jul 20 '21 15:07 le-martre