lib/pubsubstub/publish_action.rb in pubsubstub-0.0.15 vs lib/pubsubstub/publish_action.rb in pubsubstub-0.1.0.beta1
- old
+ new
@@ -1,10 +1,9 @@
module Pubsubstub
class PublishAction < Pubsubstub::Action
post '/' do
- event = Event.new(params[:data], name: params[:event])
(params[:channels] || [:default]).each do |channel_name|
- channel(channel_name).publish(event)
+ Pubsubstub.publish(channel_name, params[:data], name: params[:event])
end
""
end
end
end