 (defn update-with [user blog]
   (let [new-blog (assoc blog :user user)
         id (:id new-blog)
-        db-object (find-blog-object id)]
+        db-object (find-blog-object-by-sid id)]
     (if (and (not= nil db-object) (own? user db-object))
       (-> new-blog
           (generate-title)

(use-logging)

(defn _id-to-id [mongo-object]
  (let [id (str (:_id mongo-object))]
    (-> mongo-object (dissoc :_id) (assoc :id id))))

(defn id-to-sid [mongo-object]
  (-> mongo-object (assoc :sid (:id mongo-object))))

(defn own? [user dbo]
  (= user (:user dbo)))

  {:drop []
   :transform {:distance to-human-distance
               :time to-human-time}
   :validation [identity :sid]})

(defn from-db-to-user [obj]
  (-> obj (transform-fields-using from-db-to-user-transform) _id-to-id))
