From b97035df64f5b2f912425c4a7fcb6e6bb3ddab8d Mon Sep 17 00:00:00 2001 From: Adrien Coquio Date: Wed, 22 Jan 2014 15:49:31 +0100 Subject: [PATCH] Fix ActiveModel::Errors#has_key? return value --- activemodel/lib/active_model/errors.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 010c4bb6f9..9c3bc913e1 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -94,7 +94,7 @@ module ActiveModel # person.errors.include?(:name) # => true # person.errors.include?(:age) # => false def include?(attribute) - (v = messages[attribute]) && v.any? + messages[attribute].present? end # aliases include? alias :has_key? :include?