Sha256: bdef212bcf539f3f72c056c73ca4bc1ba084fafcabcb8478599b0462413cdc83

Contents?: true

Size: 752 Bytes

Versions: 22

Compression:

Stored size: 752 Bytes

Contents

# frozen_string_literal: true

require_relative '../analytics'

module Datadog
  module Tracing
    module Contrib
      module Rails
        # common utilities for Rails
        module Utils
          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

          def self.railtie_supported?
            !!(defined?(::Rails::VERSION::MAJOR) && ::Rails::VERSION::MAJOR >= 3 && defined?(::Rails::Railtie))
          end
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ddtrace-1.23.3 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.23.2 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.23.1 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.22.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.21.1 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.21.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.20.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.19.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.18.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.17.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.16.2 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.16.1 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.16.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.15.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.14.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.13.1 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.13.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.12.1 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.12.0 lib/datadog/tracing/contrib/rails/utils.rb
ddtrace-1.11.1 lib/datadog/tracing/contrib/rails/utils.rb