fix: adding class properties can result

in clobbered db idents. Also rename fn to make its
purpose explicit
This commit is contained in:
Gabriel Horner
2024-04-08 16:32:27 -04:00
parent ea1cc87d77
commit 6a2b6d2913
6 changed files with 33 additions and 20 deletions

View File

@@ -68,7 +68,7 @@
(->> properties
(map
(fn [[prop-name val]]
[(db-property/user-property-ident-from-name (name prop-name))
[(db-property/create-user-property-ident-from-name (name prop-name))
;; set indicates a :many value
(if (set? val)
(set (map #(translate-property-value % uuid-maps) val))
@@ -105,7 +105,7 @@
(defn- build-property-refs [properties property-db-ids]
(mapv
(fn [prop-name]
(db-property/user-property-ident-from-name (name prop-name)))
(db-property/create-user-property-ident-from-name (name prop-name)))
(keys properties)))
(def current-db-id (atom 0))
@@ -168,7 +168,7 @@
(mapcat
(fn [[prop-name]]
(if (get-in properties [prop-name :closed-values])
(let [db-ident (db-property/user-property-ident-from-name (name prop-name))]
(let [db-ident (db-property/create-user-property-ident-from-name (name prop-name))]
(db-property-util/build-closed-values
db-ident
prop-name