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.3.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.2.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.4 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.4.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.3 lib/action_cable/server/worker/active_record_connection_management.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/actioncable-5.0.2/lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.0 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.0.rc2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.0.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.2.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.1.0.beta1 lib/action_cable/server/worker/active_record_connection_management.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.1/lib/action_cable/server/worker/active_record_connection_management.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.1/lib/action_cable/server/worker/active_record_connection_management.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.1/lib/action_cable/server/worker/active_record_connection_management.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.1/lib/action_cable/server/worker/active_record_connection_management.rb
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.1/lib/action_cable/server/worker/active_record_connection_management.rb
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.1/lib/action_cable/server/worker/active_record_connection_management.rb