Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

returning errors count as 0 when errors not present

  • Loading branch information...
commit 8806ff9070f8f1acfb3a45e59deec92fe3c4db80 1 parent 271a2f4
@ginettev ginettev authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/active_merchant/common/validateable.rb
View
6 lib/active_merchant/common/validateable.rb
@@ -36,7 +36,7 @@ def initialize(base)
end
def count
- size
+ empty? ? 0 : size
end
def empty?
@@ -47,7 +47,7 @@ def empty?
# if more than one error is available we will only return the first. If no error is available
# we return an empty string
def on(field)
- self[field].to_a.first
+ self[field].to_a.first if self[:field].present?
end
def add(field, error)
@@ -78,4 +78,4 @@ def full_messages
end
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.