From 7a09fc55c0d89f6a672c79fdd9787c51a85a06fc Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Sat, 10 Jan 2015 12:24:10 -0700 Subject: Stop special casing null binary data in logging There's very little value in logging "" instead of just "nil". I'd like to remove the column from the equation entirely, and this case is preventing us from doing so. --- activerecord/lib/active_record/log_subscriber.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/log_subscriber.rb b/activerecord/lib/active_record/log_subscriber.rb index eb64d197f0..a5c7279db9 100644 --- a/activerecord/lib/active_record/log_subscriber.rb +++ b/activerecord/lib/active_record/log_subscriber.rb @@ -22,10 +22,10 @@ module ActiveRecord def render_bind(column, value) if column - if column.binary? + if column.binary? && value # This specifically deals with the PG adapter that casts bytea columns into a Hash. value = value[:value] if value.is_a?(Hash) - value = value ? "<#{value.bytesize} bytes of binary data>" : "" + value = "<#{value.bytesize} bytes of binary data>" end [column.name, value] -- cgit v1.2.3