diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-10 13:54:29 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-10 13:54:29 -0800 |
commit | 61b69338b27e3d865d4ca87269a7c12a74ea32da (patch) | |
tree | 93966a8a12fde77740a5a2f121dea2ed7ccfc3a6 /activerecord | |
parent | 2f49cd91b7fdf18a559216fa725d039a5cd78ff1 (diff) | |
download | rails-61b69338b27e3d865d4ca87269a7c12a74ea32da.tar.gz rails-61b69338b27e3d865d4ca87269a7c12a74ea32da.tar.bz2 rails-61b69338b27e3d865d4ca87269a7c12a74ea32da.zip |
simplify bind parameter logging
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/log_subscriber.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/bind_parameter_test.rb | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/log_subscriber.rb b/activerecord/lib/active_record/log_subscriber.rb index a08b3562d0..8855798bde 100644 --- a/activerecord/lib/active_record/log_subscriber.rb +++ b/activerecord/lib/active_record/log_subscriber.rb @@ -28,9 +28,7 @@ module ActiveRecord binds = nil unless (payload[:binds] || []).empty? - binds = " {" + payload[:binds].map { |col,v| - "#{col.name.inspect} => #{v.inspect}" - }.join(", ") + "}" + binds = " #{Hash[payload[:binds].map { |col,v| [col.name, v] }]}" end if odd? diff --git a/activerecord/test/cases/bind_parameter_test.rb b/activerecord/test/cases/bind_parameter_test.rb index 83001f44f9..eb2991437b 100644 --- a/activerecord/test/cases/bind_parameter_test.rb +++ b/activerecord/test/cases/bind_parameter_test.rb @@ -84,7 +84,7 @@ module ActiveRecord }.new logger.sql event - assert_match("{#{pk.name.inspect} => #{10.inspect}}", logger.debugs.first) + assert_match({pk.name => 10}.inspect, logger.debugs.first) end end end |