Module: Datadog::Tracing::Contrib::Rails::Utils

Defined in:
lib/datadog/tracing/contrib/rails/utils.rb

Overview

common utilities for Rails

Class Method Summary collapse

Class Method Details

.app_nameObject



11
12
13
14
15
16
17
# File 'lib/datadog/tracing/contrib/rails/utils.rb', line 11

def self.app_name
  if ::Rails::VERSION::MAJOR >= 6
    ::Rails.application.class.module_parent_name.underscore
  else
    ::Rails.application.class.parent_name.underscore
  end
end

.railtie_supported?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/datadog/tracing/contrib/rails/utils.rb', line 19

def self.railtie_supported?
  !!defined?(::Rails::Railtie)
end