diff options
author | James Coleman <jtc331@gmail.com> | 2014-05-02 12:32:49 -0400 |
---|---|---|
committer | James Coleman <jtc331@gmail.com> | 2014-05-02 12:39:40 -0400 |
commit | 12ff63b227e7ef01c7e57302c9999151dca157f1 (patch) | |
tree | 529ebbb8ef35930db431ae13cdb488a66c9925f8 /activerecord/lib | |
parent | 504adac36ed2b57616c34a5c1f2b565333cb9533 (diff) | |
download | rails-12ff63b227e7ef01c7e57302c9999151dca157f1.tar.gz rails-12ff63b227e7ef01c7e57302c9999151dca157f1.tar.bz2 rails-12ff63b227e7ef01c7e57302c9999151dca157f1.zip |
Fix exception when logging SQL w/ nil binary value.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/log_subscriber.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/log_subscriber.rb b/activerecord/lib/active_record/log_subscriber.rb index 654ef21b07..17d0c52e47 100644 --- a/activerecord/lib/active_record/log_subscriber.rb +++ b/activerecord/lib/active_record/log_subscriber.rb @@ -25,7 +25,7 @@ module ActiveRecord if column.binary? # This specifically deals with the PG adapter that casts bytea columns into a Hash. value = value[:value] if value.is_a?(Hash) - value = "<#{value.bytesize} bytes of binary data>" + value = value.nil? ? "<NULL binary data>" : "<#{value.bytesize} bytes of binary data>" end [column.name, value] |