     validateRuleGroup group, display, value, cb
   , cb
 
+###*
+ * Validates all values in data against the fields given in the schema.
+###
 validateAll = (schema, data, cb) ->
   valid = true
   messages = {}

      if message then cb {message} else cb()
  , cb

validateField = (field, schema, value, cb) ->
  # Get a user-friendly display name for the field.
  displayName = schema.displayName or field

_ = require "underscore"
valids = require "valids"

###*
 * Validates rules within a rule group asynchronously. This will stop
 * validating on first validation failure or error.
###
validateRuleGroup = (group, display, value, cb) ->
  async.each _.keys(group), (ruleName, cb) ->
    param = group[ruleName]
    if _.isFunction param
