softwaregravy/lancaster

View on GitHub
app/workers/notification_organizer.rb

Summary

Maintainability
A
0 mins
Test Coverage
class NotificationOrganizer
  include Sidekiq::Worker
  sidekiq_options queue: :sms

  def perform(notification_id)
    notification = Notification.find(notification_id)
    notification.notification_source.subscribable.subscriptions.find_each do |sub|
      NotificationWorker.perform_async(sub.id, notification_id)
    end
  end
end