Move default tagging configuration to the railtie

All other tags are there, so there is no need to keep them separated.
This commit is contained in:
Rafael Mendonça França 2021-08-17 22:38:27 +00:00
parent 6d983e86da
commit 84376c3e03
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
2 changed files with 4 additions and 9 deletions

View File

@ -178,11 +178,3 @@ module ActiveRecord
end
end
end
ActiveSupport.on_load(:active_record) do
ActiveRecord::QueryLogs.taggings.merge!(
socket: -> { ActiveRecord::Base.connection_db_config.socket },
db_host: -> { ActiveRecord::Base.connection_db_config.host },
database: -> { ActiveRecord::Base.connection_db_config.database }
)
end

View File

@ -348,7 +348,10 @@ To keep using the current cache store, you can turn off cache versioning entirel
if app.config.active_record.query_log_tags_enabled
ActiveRecord::QueryLogs.taggings.merge!(
application: -> { @application_name ||= Rails.application.class.name.split("::").first },
pid: -> { Process.pid }
pid: -> { Process.pid },
socket: -> { ActiveRecord::Base.connection_db_config.socket },
db_host: -> { ActiveRecord::Base.connection_db_config.host },
database: -> { ActiveRecord::Base.connection_db_config.database }
)
if app.config.active_record.query_log_tags.present?