Class: Hyrax::NotificationsChannel

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

Instance Method Summary collapse

Instance Method Details

#subscribedObject


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

def subscribed
  stream_for current_user
end

#unsubscribedObject


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

def unsubscribed
  stop_all_streams
end

#update_locale(data) ⇒ Object


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

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