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

Defined in:
lib/ddtrace/contrib/rails/utils.rb

Overview

common utilities for Rails

Class Method Summary collapse

Class Method Details

.app_nameObject



8
9
10
11
12
13
14
15
16
# File 'lib/ddtrace/contrib/rails/utils.rb', line 8

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