save-doc null, make-doc*
Sun Jun 22 11:25:00 PDT 2008 Ryszard Szopa <ryszard.szopa@gmail.com>
* save-doc null, make-doc*
diff -rN -u old-cl-couch/object-layer/transaction.lisp new-cl-couch/object-layer/transaction.lisp
--- old-cl-couch/object-layer/transaction.lisp 2014-07-28 17:37:32.000000000 -0700
+++ new-cl-couch/object-layer/transaction.lisp 2014-07-28 17:37:32.000000000 -0700
@@ -21,6 +21,9 @@
(push doc *documents-in-transaction*)
(call-next-method)))
+(defmethod save-doc ((null null) &optional db server)
+ (declare (ignore null db server)))
+
(defmethod save-doc ((list list) &optional db (server *couchdb-server*))
(let* ((some-doc (car list))
(db (or db (when (typep some-doc 'validated-doc) (default-db-of some-doc)) (original-db-of some-doc))))
diff -rN -u old-cl-couch/object-layer/validated-document.lisp new-cl-couch/object-layer/validated-document.lisp
--- old-cl-couch/object-layer/validated-document.lisp 2014-07-28 17:37:32.000000000 -0700
+++ new-cl-couch/object-layer/validated-document.lisp 2014-07-28 17:37:32.000000000 -0700
@@ -120,6 +120,8 @@
(constraints-of class) (list ,@(@ options :constraints))
(default-db-of class) ,(car (@ options :default-db)))
class)
+ (defmethod make-doc* ((cl (eql ',name)) attributes)
+ (apply 'make-doc cl (alist-plist attributes)))
(defmethod make-doc ((cl (eql ',name)) &rest keys &key &allow-other-keys)
(let ((doc ; set default values
(make-instance ',name :attributes (acons :type ,(symbol-name name) (plist-alist (list ,@initforms))))))