From e7834214a668cde0a4f7757f7f4a3d78f73f2fd8 Mon Sep 17 00:00:00 2001 From: lulalala Date: Sat, 12 Jan 2019 21:03:22 +0800 Subject: Fix equality comparison raising error bug --- activemodel/lib/active_model/error.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activemodel/lib') diff --git a/activemodel/lib/active_model/error.rb b/activemodel/lib/active_model/error.rb index 9731fa74df..5a1298e27f 100644 --- a/activemodel/lib/active_model/error.rb +++ b/activemodel/lib/active_model/error.rb @@ -64,7 +64,7 @@ module ActiveModel end def ==(other) - attributes_for_hash == other.attributes_for_hash + other.is_a?(self.class) && attributes_for_hash == other.attributes_for_hash end alias eql? == -- cgit v1.2.3