mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
14 lines
276 B
Ruby
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
|