aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/log_subscriber.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-04 18:21:36 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-04 18:21:36 -0300
commitcf0dc18ac34f45f0fd0aa231c0e59c994691d90f (patch)
treebd44876aa8b456257fbc96fefbbcf640025a3bd4 /activerecord/lib/active_record/log_subscriber.rb
parent7922ccb26189baec36f2523e034fec1560a69b03 (diff)
downloadrails-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
Diffstat (limited to 'activerecord/lib/active_record/log_subscriber.rb')
-rw-r--r--activerecord/lib/active_record/log_subscriber.rb2
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]