From 5d6500535c5bdb7691e3aead7615e4906f7128c0 Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Mon, 23 Mar 2015 15:10:04 +1030 Subject: Provide a more truthful #inspect This is obviously all very internal, but sometimes you have to look at it... and when you do, it'll save a lot of confusion if it doesn't lie about its identity. --- activerecord/lib/active_record/type/serialized.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/type/serialized.rb b/activerecord/lib/active_record/type/serialized.rb index b22828d371..ea3e0d6a45 100644 --- a/activerecord/lib/active_record/type/serialized.rb +++ b/activerecord/lib/active_record/type/serialized.rb @@ -26,6 +26,10 @@ module ActiveRecord end end + def inspect + Kernel.instance_method(:inspect).bind(self).call + end + def changed_in_place?(raw_old_value, value) return false if value.nil? raw_new_value = serialize(value) -- cgit v1.2.3