From e4aa83ae8e8b331e7246b8a566bf8db38184be64 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Fri, 12 Jan 2024 16:49:16 -0800 Subject: [PATCH] Skip patching for Rails 3 --- lib/datadog/tracing/contrib/rails/patcher.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/datadog/tracing/contrib/rails/patcher.rb b/lib/datadog/tracing/contrib/rails/patcher.rb index b7bd9eee845..b60b6db7e5b 100644 --- a/lib/datadog/tracing/contrib/rails/patcher.rb +++ b/lib/datadog/tracing/contrib/rails/patcher.rb @@ -52,7 +52,8 @@ def before_initialize(app) # Sometimes we don't want to activate middleware e.g. OpenTracing, etc. add_middleware(app) if Datadog.configuration.tracing[:rails][:middleware] - ActionDispatch::Journey::Router.prepend(JourneyRouterPatch) + # ActionDispatch::Journey not available in Rails 3.2 + ActionDispatch::Journey::Router.prepend(JourneyRouterPatch) if defined?(ActionDispatch::Journey::Router) Rails::LogInjection.configure_log_tags(app.config) end