diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb index b39e7a216..0f936d05b 100644 --- a/app/channels/application_cable/connection.rb +++ b/app/channels/application_cable/connection.rb @@ -2,8 +2,9 @@ module ApplicationCable class Connection < ActionCable::Connection::Base identified_by :current_user - tenanted_connection do - set_current_user || reject_unauthorized_connection + def connect + super + ApplicationRecord.with_tenant(current_tenant) { set_current_user || reject_unauthorized_connection } end private