Sha256: 9864fb932a605de2bb43a9d69e98917d8d16e53ac458b82e79133514e091c544

Contents?: true

Size: 441 Bytes

Versions: 51

Compression:

Stored size: 441 Bytes

Contents

module ActionCable
  module Server
    class Worker
      module ActiveRecordConnectionManagement
        extend ActiveSupport::Concern

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

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

Version data entries

51 entries across 51 versions & 4 rubygems

Version Path
actioncable-5.1.7 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.7.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.6.2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.7.2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.6.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.7.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.6 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.7 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.5 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.5.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.4 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.6 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.4.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.6.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.3 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.3.rc3 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.5 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.5.rc2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.3.rc2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.5.rc1 lib/action_cable/server/worker/active_record_connection_management.rb