Skip to content
Snippets Groups Projects
Commit 0a657530 authored by Cam Saul's avatar Cam Saul
Browse files

test fix

parent a275c18d
No related branches found
No related tags found
No related merge requests found
......@@ -288,19 +288,15 @@
;; ## EXISTS?
(defn -exists?
[entity kwargs]
(boolean (seq (k/select (i/entity->korma entity)
(k/fields [:id])
(k/where kwargs)
(k/limit 1)))))
(defmacro exists?
"Easy way to see if something exists in the db.
(exists? User :id 100)"
[entity & {:as kwargs}]
`(-exists? ~entity '~(if (seq kwargs) kwargs {})))
`(boolean (seq (k/select (i/entity->korma ~entity)
(k/fields [:id])
(k/where ~(if (seq kwargs) kwargs {}))
(k/limit 1)))))
;; ## CASADE-DELETE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment