diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-04 18:21:36 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-04 18:21:36 -0300 |
commit | cf0dc18ac34f45f0fd0aa231c0e59c994691d90f (patch) | |
tree | bd44876aa8b456257fbc96fefbbcf640025a3bd4 | |
parent | 7922ccb26189baec36f2523e034fec1560a69b03 (diff) | |
download | rails-cf0dc18ac34f45f0fd0aa231c0e59c994691d90f.tar.gz rails-cf0dc18ac34f45f0fd0aa231c0e59c994691d90f.tar.bz2 rails-cf0dc18ac34f45f0fd0aa231c0e59c994691d90f.zip |
Invert the if/else clause
The case where the value is present is more common
-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 17d0c52e47..eb64d197f0 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.nil? ? "<NULL binary data>" : "<#{value.bytesize} bytes of binary data>" + value = value ? "<#{value.bytesize} bytes of binary data>" : "<NULL binary data>" end [column.name, value] |