File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
lib/datadog/appsec/contrib/active_record Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -76,16 +76,22 @@ def patch_mysql2_adapter
7676 end
7777
7878 def patch_postgresql_adapter
79- jdbc_defined = defined? ( ::ActiveRecord ::ConnectionAdapters ::JdbcAdapter )
80-
81- instrumentation_module = if jdbc_defined && ::ActiveRecord . gem_version >= Gem ::Version . new ( '7.1' )
82- Instrumentation ::InternalExecQueryAdapterPatch
83- elsif jdbc_defined && ::ActiveRecord . gem_version . segments . first == 4
79+ instrumentation_module = if ::ActiveRecord . gem_version . segments . first == 4
8480 Instrumentation ::Rails4ExecuteAndClearAdapterPatch
8581 else
8682 Instrumentation ::ExecuteAndClearAdapterPatch
8783 end
8884
85+ if defined? ( ::ActiveRecord ::ConnectionAdapters ::JdbcAdapter )
86+ instrumentation_module = if ::ActiveRecord . gem_version >= Gem ::Version . new ( '7.1' )
87+ Instrumentation ::InternalExecQueryAdapterPatch
88+ elsif ::ActiveRecord . gem_version . segments . first == 4
89+ Instrumentation ::Rails4ExecQueryAdapterPatch
90+ else
91+ Instrumentation ::ExecQueryAdapterPatch
92+ end
93+ end
94+
8995 ::ActiveRecord ::ConnectionAdapters ::PostgreSQLAdapter . prepend ( instrumentation_module )
9096 end
9197 end
You can’t perform that action at this time.
0 commit comments