octobox/octobox

View on GitHub
app/channels/notifications_channel.rb

Summary

Maintainability
A
0 mins
Test Coverage
class NotificationsChannel < ApplicationCable::Channel
  def subscribed
      if current_user.nil? 
              reject
      else
          stream_from "notifications:#{current_user.id}"
      end
  end

  def unsubscribed
    stop_all_streams
  end
end