Skip to content

Commit

Permalink
Removing method calls to methods that don't always exist
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
kevintom committed Feb 10, 2012
1 parent e291fd3 commit 963c772
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/new_relic/agent/instrumentation/sequel.rb
Expand Up @@ -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

Expand Down

0 comments on commit 963c772

Please sign in to comment.