lib/new_relic/control/frameworks/rails.rb in newrelic_rpm-3.5.2.17 vs lib/new_relic/control/frameworks/rails.rb in newrelic_rpm-3.5.3.24
- old
+ new
@@ -156,13 +156,13 @@
end
def install_shim
super
require 'new_relic/agent/instrumentation/controller_instrumentation'
- if !ActiveSupport.respond_to?(:on_load) # rails 3+
- ActionController::Base.class_eval do
- include NewRelic::Agent::Instrumentation::ControllerInstrumentation::Shim
- end
+ if ActiveSupport.respond_to?(:on_load) # rails 3+
+ ActiveSupport.on_load(:action_controller) { include NewRelic::Agent::Instrumentation::ControllerInstrumentation::Shim }
+ else
+ ActionController::Base.class_eval { include NewRelic::Agent::Instrumentation::ControllerInstrumentation::Shim }
end
end
end
end
end