From 702b1768c425e7187ef4c62beb1ed12ed7774d83 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Wed, 6 Jun 2018 19:20:13 +0900 Subject: Fix force equality checking not to break the serialized attribute with Array Context: https://github.com/rails/rails/commit/43ef00e5d7a55ad79bc840276d33cb70f1f5dde5#commitcomment-29256140 --- activerecord/lib/active_record/type/serialized.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/lib/active_record/type/serialized.rb') diff --git a/activerecord/lib/active_record/type/serialized.rb b/activerecord/lib/active_record/type/serialized.rb index e882784691..0a2f6cb9fb 100644 --- a/activerecord/lib/active_record/type/serialized.rb +++ b/activerecord/lib/active_record/type/serialized.rb @@ -51,6 +51,10 @@ module ActiveRecord end end + def force_equality?(value) + coder.respond_to?(:object_class) && value.is_a?(coder.object_class) + end + private def default_value?(value) -- cgit v1.2.3