metamaps--metamaps/app/channels/map_channel.rb

9 lines
271 B
Ruby
Raw Normal View History

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
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
end