Sha256: b84aa0ee4817b441f52dde405cee4466f36b87b2c8a8820a37e3483c9cb4c098

Contents?: true

Size: 468 Bytes

Versions: 8

Compression:

Stored size: 468 Bytes

Contents

class Cubism::Presence < ActionCable::Channel::Base
  def subscribed
    resource = GlobalID::Locator.locate_signed params[:signed_resource]
    if resource.present?
      stream_for resource
      resource.present_users.add(current_user.id)
    else
      reject
    end
  end

  def unsubscribed
    resource = GlobalID::Locator.locate_signed params[:signed_resource]
    return unless resource.present?

    resource.present_users.remove(current_user.id)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cubism-0.1.0.pre8 app/channels/cubism/presence.rb~
cubism-0.1.0.pre7 app/channels/cubism/presence.rb~
cubism-0.1.0.pre6 app/channels/cubism/presence.rb~
cubism-0.1.0.pre5 app/channels/cubism/presence.rb~
cubism-0.1.0.pre4 app/channels/cubism/presence.rb~
cubism-0.1.0.pre3 app/channels/cubism/presence.rb~
cubism-0.1.0.pre2 app/channels/cubism/presence.rb~
cubism-0.1.0.pre1 app/channels/cubism/presence.rb~