Files
openfoodnetwork/app/channels/session_channel.rb
2023-05-26 13:26:30 +10:00

14 lines
276 B
Ruby

# frozen_string_literal: true
class SessionChannel < ApplicationCable::Channel
def self.for_request(request)
"SessionChannel:#{request.session.id}"
end
def subscribed
return reject if current_user.nil?
stream_from "SessionChannel:#{session_id}"
end
end