metamaps--metamaps/app/channels/map_channel.rb
2017-01-03 15:09:20 -05:00

8 lines
271 B
Ruby

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