From 089d112b0d2dc3e6956674464859d6d1ed27aa34 Mon Sep 17 00:00:00 2001 From: Katherine Oelsner <49968061+octokatherine@users.noreply.github.com> Date: Wed, 25 Oct 2023 21:42:03 +0000 Subject: [PATCH] convert Rails version string to Gem::Version --- .../instrumentation/active_support/span_subscriber.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/span_subscriber.rb b/instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/span_subscriber.rb index f241e6673..8d3cbfc0f 100644 --- a/instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/span_subscriber.rb +++ b/instrumentation/active_support/lib/opentelemetry/instrumentation/active_support/span_subscriber.rb @@ -30,7 +30,7 @@ def self.subscribe( subscriber_object = ::ActiveSupport::Notifications.subscribe(pattern, subscriber) - if Rails.version < Gem::Version.new('7.2') + if Gem::Version.new(Rails.version) < Gem::Version.new('7.2') ::ActiveSupport::Notifications.notifier.synchronize do subscribers = ::ActiveSupport::Notifications.notifier.instance_variable_get(:@string_subscribers)[pattern]