123456789_123456789_123456789_123456789_123456789_

Module: ActionCable::Server::Worker::ActiveRecordConnectionManagement

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Defined in: actioncable/lib/action_cable/server/worker/active_record_connection_management.rb

Class Method Summary

Instance Method Summary

DSL Calls

included

[ GitHub ]


9
10
11
12
13
# File 'actioncable/lib/action_cable/server/worker/active_record_connection_management.rb', line 9

included do
  if defined?(ActiveRecord::Base)
    set_callback :work, :around, :with_database_connections
  end
end

Instance Method Details

#with_database_connections

[ GitHub ]

  
# File 'actioncable/lib/action_cable/server/worker/active_record_connection_management.rb', line 15

def with_database_connections
  connection.logger.tag(ActiveRecord::Base.logger) { yield }
end