2017-01-24 00:30:13 +00:00
|
|
|
# frozen_string_literal: true
|
2017-01-03 21:12:58 +00:00
|
|
|
class MapChannel < ApplicationCable::Channel
|
|
|
|
# Called when the consumer has successfully
|
|
|
|
# become a subscriber of this channel.
|
|
|
|
def subscribed
|
|
|
|
return unless Pundit.policy(current_user, Map.find(params[:id])).show?
|
|
|
|
stream_from "map_#{params[:id]}"
|
|
|
|
end
|
|
|
|
end
|