added autovalidation (auto_validate! in your ExtendedDocument) and extracted some extlib stuff so we will soon be able to remove the dependency.

This commit is contained in:
Matt Aimonetti 2009-02-05 17:06:12 -08:00
parent e9930c5a86
commit 890b60cae4
18 changed files with 497 additions and 52 deletions

View file

@ -75,7 +75,7 @@ module CouchRest
# @param <Symbol> field_name the name of the field that caused the error
# @param <String> message the message to add
def add(field_name, message)
(errors[field_name] ||= []) << message
(errors[field_name.to_sym] ||= []) << message
end
# Collect all errors into a single list.