Sha256: 4c9d093a3ded9a702abc4fc1f82eb4e5f1f6b1b3fd2f0f5780801a938fc2f397
Contents?: true
Size: 1.06 KB
Versions: 16
Compression:
Stored size: 1.06 KB
Contents
# typed: true module Datadog module Tracing module Contrib module ActiveRecord module Configuration # The `makara` gem has the concept of **role**, which can be # inferred from the configuration `name`, in the form of: # `master/0`, `replica/0`, `replica/1`, etc. # The first part of this string is the database role. # # This allows the matching of a connection based on its role, # instead of connection-specific information. module MakaraResolver def normalize_for_config(active_record_config) hash = super hash[:makara_role] = active_record_config[:makara_role] hash end def normalize_for_resolve(active_record_config) hash = super if active_record_config[:name].is_a?(String) hash[:makara_role] = active_record_config[:name].split('/')[0].to_s end hash end end end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems