aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2015-03-23 15:10:04 +1030
committerMatthew Draper <matthew@trebex.net>2015-03-23 15:29:23 +1030
commit5d6500535c5bdb7691e3aead7615e4906f7128c0 (patch)
tree97ae2f0af922fc1a71f69e2634456bd3d8f3d7e5 /activerecord/lib/active_record
parent8b96c0b7a3510bc2a3ffe183318b7b6bcdf89ff3 (diff)
downloadrails-5d6500535c5bdb7691e3aead7615e4906f7128c0.tar.gz
rails-5d6500535c5bdb7691e3aead7615e4906f7128c0.tar.bz2
rails-5d6500535c5bdb7691e3aead7615e4906f7128c0.zip
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.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/type/serialized.rb4
1 files changed, 4 insertions, 0 deletions
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)