From 33d5eccb700318ca1fe1b67fbff3a3d86b1888ba Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 26 Jun 2025 15:03:39 -0400 Subject: [PATCH] Use the new AR::Tenanted convention for action cable connections --- app/channels/application_cable/connection.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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