Added ValidationErrors#count in order to play nicely with Rails

This commit is contained in:
Peter Wagenet 2009-07-21 16:54:31 -07:00 committed by Matt Aimonetti
parent 52255e50a2
commit 153ce54b1e

View file

@ -104,6 +104,13 @@ module CouchRest
entries.empty?
end
# Return size of errors hash
#
# Allows us to play nicely with Rails' helpers
def count
errors.size
end
def method_missing(meth, *args, &block)
errors.send(meth, *args, &block)
end