From 963c7723f68653b18a36b8151c209497943883cf Mon Sep 17 00:00:00 2001 From: Kevin Tom Date: Fri, 10 Feb 2012 11:00:58 -0800 Subject: [PATCH] Removing method calls to methods that don't always exist - first_source isn't always available - Models are dataset and have a #model and #first_source but a dataset isn't necessarily a model, so it will not always respond to those method calls. --- lib/new_relic/agent/instrumentation/sequel.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/new_relic/agent/instrumentation/sequel.rb b/lib/new_relic/agent/instrumentation/sequel.rb index c1986fbe5c..4714cb9d88 100644 --- a/lib/new_relic/agent/instrumentation/sequel.rb +++ b/lib/new_relic/agent/instrumentation/sequel.rb @@ -49,10 +49,10 @@ # Sequel's Dataset instance methods ::Sequel::Dataset.class_eval do - add_method_tracer :execute, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : "Dataset#{self.first_source}"}/find' - add_method_tracer :execute_insert, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : "Dataset#{self.first_source}"}/create' - add_method_tracer :execute_dui, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : "Dataset#{self.first_source}"}/update' - add_method_tracer :execute_ddl, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : "Dataset#{self.first_source}"}/all' + add_method_tracer :execute, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : self.sql}/find' + add_method_tracer :execute_insert, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : self.sql}/create' + add_method_tracer :execute_dui, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : self.sql}/update' + add_method_tracer :execute_ddl, 'ActiveRecord/#{self.respond_to?(:model) ? self.model.name : self.sql}/all' end