Added ValidationErrors#count in order to play nicely with Rails
This commit is contained in:
parent
52255e50a2
commit
153ce54b1e
|
@ -104,6 +104,13 @@ module CouchRest
|
||||||
entries.empty?
|
entries.empty?
|
||||||
end
|
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)
|
def method_missing(meth, *args, &block)
|
||||||
errors.send(meth, *args, &block)
|
errors.send(meth, *args, &block)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue