From 3d1a879f4cf9931a81477b63f9f999d52bac771c Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Wed, 9 Jan 2013 03:30:37 +0900 Subject: Ignore binds payload with nil column in AR log subscriber Some tests were raising the following error: Could not log "sql.active_record" event. NoMethodError: undefined method `type' for nil:NilClass` Due to the way binds were being logged, the column info was considered always present, but that is not true for some of the tests listed in the issue. Closes #8806. Conflicts: activerecord/lib/active_record/log_subscriber.rb activerecord/test/cases/log_subscriber_test.rb Conflict resolution: - Revert ruby 1.9 style hash to support ruby 1.8 - Do not include 8f59ffce into 3-2-stable --- activerecord/lib/active_record/log_subscriber.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/log_subscriber.rb b/activerecord/lib/active_record/log_subscriber.rb index a25f2c7bca..2b6488f183 100644 --- a/activerecord/lib/active_record/log_subscriber.rb +++ b/activerecord/lib/active_record/log_subscriber.rb @@ -32,7 +32,11 @@ module ActiveRecord unless (payload[:binds] || []).empty? binds = " " + payload[:binds].map { |col,v| - [col.name, v] + if col + [col.name, v] + else + [nil, v] + end }.inspect end -- cgit v1.2.3