Use the new AR::Tenanted convention for action cable connections

This commit is contained in:
Mike Dalessio
2025-06-26 15:03:39 -04:00
parent f43a5ff22c
commit 33d5eccb70
+3 -2
View File
@@ -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