class ScoutApm::FrameworkIntegrations::Rails2

Public Instance Methods

application_name() click to toggle source
# File lib/scout_apm/framework_integrations/rails_2.rb, line 23
def application_name
  if defined?(::Rails)
    ::Rails.application.class.to_s.
      sub(/::Application$/, '')
  end
rescue
  nil
end
database_engine() click to toggle source

Attempts to determine the database engine being used

# File lib/scout_apm/framework_integrations/rails_2.rb, line 37
def database_engine
  default = :mysql

  if defined?(ActiveRecord::Base)
    case raw_database_adapter
    when "postgres"   then :postgres
    when "postgresql" then :postgres
    when "postgis"    then :postgres
    when "sqlite3"    then :sqlite
    when "mysql"      then :mysql
    when "mysql2"     then :mysql
    else default
    end
  else
    default
  end
rescue
  default
end
env() click to toggle source
# File lib/scout_apm/framework_integrations/rails_2.rb, line 32
def env
  RAILS_ENV.dup
end
human_name() click to toggle source
# File lib/scout_apm/framework_integrations/rails_2.rb, line 8
def human_name
  "Rails"
end
name() click to toggle source
# File lib/scout_apm/framework_integrations/rails_2.rb, line 4
def name
  :rails
end
present?() click to toggle source
# File lib/scout_apm/framework_integrations/rails_2.rb, line 16
def present?
  defined?(::Rails) &&
    defined?(::Rails::VERSION) &&
      defined?(ActionController) &&
    Rails::VERSION::MAJOR < 3
end
raw_database_adapter() click to toggle source
# File lib/scout_apm/framework_integrations/rails_2.rb, line 57
def raw_database_adapter
  ActiveRecord::Base.configurations[env]["adapter"]
rescue
  nil
end
version() click to toggle source
# File lib/scout_apm/framework_integrations/rails_2.rb, line 12
def version
  Rails::VERSION::STRING
end