Added ValidationErrors#count in order to play nicely with Rails
This commit is contained in:
parent
52255e50a2
commit
153ce54b1e
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue