Cached object ids won't work, per (long) discussion with Alex
This commit is contained in:
parent
0f867b8236
commit
e54bd37932
2 changed files with 0 additions and 9 deletions
|
|
@ -41,8 +41,6 @@
|
||||||
|
|
||||||
(def factories (atom {}))
|
(def factories (atom {}))
|
||||||
(def defaults (atom {}))
|
(def defaults (atom {}))
|
||||||
(def oids (atom {}))
|
|
||||||
|
|
||||||
|
|
||||||
(defn defaults-for
|
(defn defaults-for
|
||||||
[f-group & { :as attributes }]
|
[f-group & { :as attributes }]
|
||||||
|
|
@ -66,10 +64,4 @@
|
||||||
(let [doc (apply build f-group f-name (flatten (vec overrides)))
|
(let [doc (apply build f-group f-name (flatten (vec overrides)))
|
||||||
oid (:_id doc)]
|
oid (:_id doc)]
|
||||||
(assert (mr/ok? (mc/insert f-group doc)))
|
(assert (mr/ok? (mc/insert f-group doc)))
|
||||||
(swap! oids (fn [a]
|
|
||||||
(assoc-in a [(name f-group) (name f-name)] oid)))
|
|
||||||
doc)))
|
doc)))
|
||||||
|
|
||||||
(defn oid-of
|
|
||||||
[f-group f-name]
|
|
||||||
(get-in @oids [(name f-group) (name f-name)]))
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,6 @@
|
||||||
doc (seed "domains" "clojure.org" :created-at t)]
|
doc (seed "domains" "clojure.org" :created-at t)]
|
||||||
(is (= 1 (mc/count "domains")))
|
(is (= 1 (mc/count "domains")))
|
||||||
(is (:_id doc))
|
(is (:_id doc))
|
||||||
(is (= (:_id doc) (oid-of "domains" "clojure.org")))
|
|
||||||
(is (= t (:created-at doc)))
|
(is (= t (:created-at doc)))
|
||||||
(is (= "clojure.org" (:name doc)))
|
(is (= "clojure.org" (:name doc)))
|
||||||
(is (false? (:ipv6-enabled doc)))))
|
(is (false? (:ipv6-enabled doc)))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue