From 66e747b461457b4f49d5b5d88334f5019bbfcc1e Mon Sep 17 00:00:00 2001 From: Antonio Roberto Date: Fri, 16 Dec 2011 17:17:14 -0200 Subject: Fixed bug when error message is an empty string. --- activemodel/lib/active_model/errors.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activemodel/lib/active_model') diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 8337b04c0d..aafd1c8a74 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -176,8 +176,9 @@ module ActiveModel end # Returns true if no errors are found, false otherwise. + # If the error message is a string it can be empty. def empty? - all? { |k, v| v && v.empty? } + all? { |k, v| v && v.empty? && !v.is_a?(String) } end alias_method :blank?, :empty? -- cgit v1.2.3