Sha256: 1562209dd64bbef5a5e6b5670b737b153559a0ffb64b4a36f42d785452df832e

Contents?: true

Size: 683 Bytes

Versions: 5

Compression:

Stored size: 683 Bytes

Contents

# typed: false
require 'ddtrace/contrib/analytics'

module Datadog
  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)).nil?
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ddtrace-0.54.2 lib/ddtrace/contrib/rails/utils.rb
ddtrace-0.54.1 lib/ddtrace/contrib/rails/utils.rb
ddtrace-0.54.0 lib/ddtrace/contrib/rails/utils.rb
ddtrace-0.53.0 lib/ddtrace/contrib/rails/utils.rb
ddtrace-0.52.0 lib/ddtrace/contrib/rails/utils.rb