Sha256: 7980e96c72cdaa874a3c5ff6bd34124006d7fbf0496cf2c65c9aa968cbac6efa

Contents?: true

Size: 472 Bytes

Versions: 109

Compression:

Stored size: 472 Bytes

Contents

# frozen_string_literal: true

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

109 entries across 109 versions & 9 rubygems

Version Path
actioncable-6.1.7.10 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.1.7.9 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.1.7.8 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.1.7.7 lib/action_cable/server/worker/active_record_connection_management.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/actioncable-6.1.6.1/lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.1.7.6 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.1.7.5 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.1.7.4 lib/action_cable/server/worker/active_record_connection_management.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/actioncable-6.1.6.1/lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.1.7.3 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.1.7.2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.1.7.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.0.6.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.1.7 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.0.6 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.1.6.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.0.5.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.2.8.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.2.8 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-6.0.5 lib/action_cable/server/worker/active_record_connection_management.rb