Class: ActivityNotification::NotificationApiChannel

Inherits:
NotificationChannel show all
Defined in:
app/channels/activity_notification/notification_api_channel.rb

Overview

Action Cable API channel to subscribe broadcasted notifications.

Direct Known Subclasses

NotificationApiWithDeviseChannel

Instance Method Summary collapse

Instance Method Details

#subscribedObject

ActionCable::Channel::Base#subscribed



6
7
8
9
10
# File 'app/channels/activity_notification/notification_api_channel.rb', line 6

def subscribed
  stream_from "#{ActivityNotification.config.notification_api_channel_prefix}_#{@target.to_class_name}#{ActivityNotification.config.composite_key_delimiter}#{@target.id}"
rescue
  reject
end