Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

A bit of formatting and documentation.

  • Loading branch information...
commit 3a6ed19ea51a95545fc493105afc5e30c26af802 1 parent f34816b
@duelinmarkers authored
3  src/clj_record/callbacks/built_ins.clj
@@ -1,4 +1,5 @@
-(ns clj-record.callbacks.built-ins)
+(ns clj-record.callbacks.built-ins
+ "Built-in helpers for use in the (init-model (:callbacks ...)) form.")
(defn transform-value
9 src/clj_record/core.clj
@@ -1,4 +1,7 @@
(ns clj-record.core
+ "This is the heart of clj-record. The primary functions generated in your model namespace
+ by (init-model ...) delegate to same-named functions in this namespace. The functions here
+ take an extra model-name String as their first argument."
(:require [ :as sql]
[clojure.string :as string])
(:use (clj-record meta util callbacks)))
@@ -192,8 +195,8 @@ instance."
The segment of the namespace name following the last dot is used as the model-name.
Model-specific versions of most public functions in clj-record.core are defined
in the model namespace (minus the model-name as first argument).
- Optional forms for associations and validation are specified here.
+ Optional forms for associations, validation, etc. are specified here.
See clj_record/test/model/manufacturer.clj for an example."
[& init-options]
(let [model-name (last (string/split (name (ns-name *ns*)) #"\."))
@@ -209,7 +212,7 @@ instance."
(defn ~'model-metadata [& args#]
(apply model-metadata-for ~model-name args#))
(defn ~'table-name [] (table-name ~model-name))
- (defn ~'record-count
+ (defn ~'record-count
([] (record-count ~model-name))
([attributes#] (record-count ~model-name attributes#)))
(defn ~'get-record [id#]
1  src/clj_record/validation/built_ins.clj
@@ -1,4 +1,5 @@
(ns clj-record.validation.built-ins
+ "Built-in validation functions for use in the (init-model (:validation ...)) form."
(:require [clojure.string :as string]))

0 comments on commit 3a6ed19

Please sign in to comment.
Something went wrong with that request. Please try again.