2016-12-29 05:52:00 +00:00
|
|
|
class MapChannel < ApplicationCable::Channel
|
|
|
|
# Called when the consumer has successfully
|
|
|
|
# become a subscriber of this channel.
|
|
|
|
def subscribed
|
2017-01-03 15:09:20 -05:00
|
|
|
return unless Pundit.policy(current_user, Map.find(params[:id])).show?
|
2016-12-29 05:52:00 +00:00
|
|
|
stream_from "map_#{params[:id]}"
|
|
|
|
end
|
2017-01-03 15:09:20 -05:00
|
|
|
end
|