X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/799ee65db4f2b83d8600920db490213bc167841f..8e6e6b5651e88009c62f5502b4fabdf2919e0b4f:/src/mewa/slot-presentations.lisp diff --git a/src/mewa/slot-presentations.lisp b/src/mewa/slot-presentations.lisp index f501b71..db5de2e 100644 --- a/src/mewa/slot-presentations.lisp +++ b/src/mewa/slot-presentations.lisp @@ -170,7 +170,12 @@ When T, only the default value for primary keys and the joins are updated.")) (defaction add-to-has-many ((slot has-many-slot-presentation) instance) + ;; if the instance is not stored we must make sure to mark it stored now! + (unless (mewa::instance-is-stored-p instance) + (setf (mewa::modifiedp (parent self)) t)) + ;; sync up the instance (mewa:ensure-instance-sync (parent slot)) + (multiple-value-bindf (class home foreign) (meta-model:explode-has-many instance (slot-name slot)) (let ((new (make-instance class)))