count-anything/app/channels/application_cable/connection.rb
Louis Vallat d07857c011
feat: added counts and instant update and destroy
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
2023-02-05 21:01:07 +01:00

19 lines
336 B
Ruby

module ApplicationCable
class Connection < ActionCable::Connection::Base
identified_by :current_user
def connect
self.current_user = find_verified_user
end
private
def find_verified_user
if (verified_user = env['warden'].user)
verified_user
else
nil
end
end
end
end