Class: Hyrax::NotificationsChannel

Inherits:
ApplicationCable::Channel show all
Defined in:
app/channels/hyrax/notifications_channel.rb

Instance Method Summary collapse

Instance Method Details

#subscribedObject



4
5
6
# File 'app/channels/hyrax/notifications_channel.rb', line 4

def subscribed
  stream_for current_user
end

#unsubscribedObject



8
9
10
# File 'app/channels/hyrax/notifications_channel.rb', line 8

def unsubscribed
  stop_all_streams
end

#update_locale(data) ⇒ Object



12
13
14
# File 'app/channels/hyrax/notifications_channel.rb', line 12

def update_locale(data)
  current_user.update(preferred_locale: data['locale'])
end