       attributes)]
     (apply vector (str-utils/str-join " AND " parameterized-conditions) values)))
 
-(defn find-records [model-name attributes]
-  (let [[parameterized-where & values] (to-conditions attributes)
-        select-query (format "select * from %s where %s" (table-name model-name) parameterized-where)]
-    (sql/with-connection db
-      (sql/with-query-results rows (apply vector select-query values)
-        (doall (map #(merge {} %) rows))))))
-
 (defn create [model-name attributes]
   (sql/with-connection db
     (let

(defn destroy-records [model-name attributes]
  (sql/with-connection db
    (sql/delete-rows (table-name model-name) (to-conditions attributes))))

(defn update [model-name attributes]
  (sql/with-connection db
    (sql/update-values (table-name model-name) ["id = ?" (:id attributes)] (dissoc attributes :id))))

(defn- defs-from-option-groups [model-name option-groups]
  (reduce


(defn table-name [model-name]
  (pluralize (if (string? model-name) model-name (name model-name))))

(defn to-conditions [attributes]
  (let [[parameterized-conditions values] (reduce
