Skip to content

Instantly share code, notes, and snippets.

View slagyr's full-sized avatar

Micah Martin slagyr

  • Clean Coders, LLC
  • Scottsdale, AZ
View GitHub Profile
@slagyr
slagyr / gist:1164267
Created August 23, 2011 03:22 — forked from pitluga/gist:1164228
simple validation
(defn validate [params-hash]
(let [keys [:model :pk]
missing-keys (filter #(nil? (params-hash %)) keys)]
(apply hash-map (interleave missing-keys (repeat "is required")))))