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-next-0.1.2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-8.0.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-8.0.0.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-7.2.2.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-8.0.0 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-7.2.2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-8.0.0.rc2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-7.2.1.2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-8.0.0.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-7.2.1.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-next-0.1.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-next-0.1.0 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-8.0.0.beta1 lib/action_cable/server/worker/active_record_connection_management.rb
omg-actioncable-8.0.0.alpha9 lib/action_cable/server/worker/active_record_connection_management.rb
omg-actioncable-8.0.0.alpha8 lib/action_cable/server/worker/active_record_connection_management.rb
omg-actioncable-8.0.0.alpha7 lib/action_cable/server/worker/active_record_connection_management.rb
omg-actioncable-8.0.0.alpha4 lib/action_cable/server/worker/active_record_connection_management.rb
omg-actioncable-8.0.0.alpha3 lib/action_cable/server/worker/active_record_connection_management.rb
omg-actioncable-8.0.0.alpha2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-7.2.1 lib/action_cable/server/worker/active_record_connection_management.rb