 (declare rules transform-entity)
 
 (defmacro one
-  [ref-fn rules]
-  `#(transform-entity ~rules (~ref-fn %)))
+  [ent-fn rules]
+  `#(transform-entity ~rules (~ent-fn %)))
 
 (defmacro many
   [remote-key rules]

          :username :user/username
          :email :user/email}})

(defn transform-entity
  ;; Given a map of transformations, apply them such that a map is
  ;; returned where the keys of the return and the transformations are

  [ref-attr]
  #(ffirst (db/q [:find '(count ?c) :where ['?c ref-attr (:db/id %)]])))

(def oldrules
  {:topic {:id :db/id
           :title :topic/title
           :first-post (one :topic/first-post (:post rules))
