Merge pull request #38013 from kamipo/remove_connection_id

Remove `:connection_id` in an internal instrument
This commit is contained in:
Ryuta Kamizono 2019-12-18 18:29:36 +09:00 committed by GitHub
commit 5d00eb41ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 5 deletions

@ -1046,9 +1046,7 @@ def establish_connection(config, pool_key = :default)
remove_connection(pool_config.connection_specification_name, pool_key)
message_bus = ActiveSupport::Notifications.instrumenter
payload = {
connection_id: object_id
}
payload = {}
if pool_config
payload[:spec_name] = pool_config.connection_specification_name
payload[:config] = db_config.configuration_hash

@ -496,7 +496,7 @@ def test_connection_notification_is_called
end
ConnectionTestModel.establish_connection :arunit
assert_equal [:config, :connection_id, :spec_name], payloads[0].keys.sort
assert_equal [:config, :spec_name], payloads[0].keys.sort
assert_equal "ActiveRecord::ConnectionAdapters::ConnectionPoolTest::ConnectionTestModel", payloads[0][:spec_name]
ensure
ActiveSupport::Notifications.unsubscribe(subscription) if subscription

@ -954,7 +954,6 @@ def fire_connection_notification(connection)
payload = {
spec_name: "book",
config: nil,
connection_id: connection.object_id
}
message_bus.instrument("!connection.active_record", payload) { }