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
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/actioncable-5.0.1/lib/action_cable/server/worker/active_record_connection_management.rb
abaci-0.3.0 vendor/bundle/gems/actioncable-5.0.0/lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.1.rc2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.1.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.0.1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.0 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.0.rc2 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.0.racecar1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.0.rc1 lib/action_cable/server/worker/active_record_connection_management.rb
actioncable-5.0.0.beta4 lib/action_cable/server/worker/active_record_connection_management.rb