From: drewc Date: Fri, 17 Jun 2005 02:58:49 +0000 (-0700) Subject: explode-foreign-key now returns an empty instance if the key is NIL. also, as a secon... X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/commitdiff_plain/4eabb2133fe55a12c9c56e766cbe3db1c25d56ab explode-foreign-key now returns an empty instance if the key is NIL. also, as a second value it returns the name of toe forgeign slot. darcs-hash:20050617025849-39164-355e54ff23d6d991905567868c38e914922728d0.gz --- diff --git a/src/meta-model.lisp b/src/meta-model.lisp index b0d1ff5..9ea1d3c 100644 --- a/src/meta-model.lisp +++ b/src/meta-model.lisp @@ -160,7 +160,9 @@ "returns the clsql view-class joined on SLOT" (dolist (s (list-join-attributes model)) (when (equal (getf (cdr s) :home-key) slot) - (return-from explode-foreign-key (slot-value model (car s)))))) + (let ((val (slot-value model (car s)))) + (return-from explode-foreign-key + (values (if val val (make-instance (getf (cdr s) :join-class))) (getf (cdr s) :foreign-key))))))) (defun find-join-helper (foreign-key) (lambda (class slot)