class NewRelic::Agent::DatabaseAdapter

Constants

VERSIONS

Attributes

env[R]
version[R]

Public Class Methods

new(env, version) click to toggle source
# File lib/new_relic/agent/database_adapter.rb, line 22
def initialize(env, version)
  @env = env
  @version = Gem::Version.new(version)
end
value() click to toggle source
# File lib/new_relic/agent/database_adapter.rb, line 14
def self.value
  return unless defined? ActiveRecord::Base

  new(::NewRelic::Control.instance.env, ActiveRecord::VERSION::STRING).value
end

Public Instance Methods

value() click to toggle source
# File lib/new_relic/agent/database_adapter.rb, line 27
def value
  match = VERSIONS.keys.find { |key| version >= Gem::Version.new(key) }
  return unless match

  VERSIONS[match].call(env)
end