Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

A bit of formatting and documentation.

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

0 notes on commit 3a6ed19

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