Sha256: 10d0defd5de501ccafc0f94d0f7d8ee57a8989940ba81580a248c6055a62d25f

Contents?: true

Size: 499 Bytes

Versions: 25

Compression:

Stored size: 499 Bytes

Contents

# frozen_string_literal: true

# :markup: markdown

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(&block)
          connection.logger.tag(ActiveRecord::Base.logger, &block)
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
actioncable-7.2.0 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-7.2.0.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-7.2.0.beta3 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-7.2.0.beta2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-7.2.0.beta1 lib/action_cable/server/worker/active_record_connection_management.rb