aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorlulalala <mark@goodlife.tw>2019-01-12 21:03:22 +0800
committerlulalala <mark@goodlife.tw>2019-03-31 22:59:13 +0800
commite7834214a668cde0a4f7757f7f4a3d78f73f2fd8 (patch)
treeb84d2e49b8677faff0c69ae6808d4de0acc1504f /activemodel/lib
parent90815b12c51284b497d55ef52ce4e962f5d33f7f (diff)
downloadrails-e7834214a668cde0a4f7757f7f4a3d78f73f2fd8.tar.gz
rails-e7834214a668cde0a4f7757f7f4a3d78f73f2fd8.tar.bz2
rails-e7834214a668cde0a4f7757f7f4a3d78f73f2fd8.zip
Fix equality comparison raising error bug
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/error.rb2
1 files changed, 1 insertions, 1 deletions
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? ==