Module: Gorynich::Head::ActionCable::Channel

Defined in:
lib/gorynich/head/action_cable.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.broadcasting_for(model) ⇒ Object



36
37
38
39
40
# File 'lib/gorynich/head/action_cable.rb', line 36

def self.broadcasting_for(model)
  raise 'unable to broadcast message without tenant' if ::Gorynich::Current.tenant.nil?

  serialize_broadcasting([channel_name, ::Gorynich::Current.tenant, model])
end

Instance Method Details

#perform_action(*args) ⇒ Object



30
31
32
33
34
# File 'lib/gorynich/head/action_cable.rb', line 30

def perform_action(*args)
  ::Gorynich.with(tenant, host: host) do
    super
  end
end

#subscribe_to_channel(*args) ⇒ Object



18
19
20
21
22
# File 'lib/gorynich/head/action_cable.rb', line 18

def subscribe_to_channel(*args)
  ::Gorynich.with(tenant, host: host) do
    super
  end
end

#unsubscribe_from_channel(*args) ⇒ Object



24
25
26
27
28
# File 'lib/gorynich/head/action_cable.rb', line 24

def unsubscribe_from_channel(*args)
  ::Gorynich.with(tenant, host: host) do
    super
  end
end