crowdAI/crowdai

View on GitHub
app/jobs/every_topic_notification_job.rb

Summary

Maintainability
A
0 mins
Test Coverage
class EveryTopicNotificationJob < ApplicationJob
  queue_as :default

  def perform(topic_id)
    topic = Topic.find(topic_id)
    pi = participant_ids(topic_id)
    participant_ids(topic_id).each do |participant_id|
      TopicNotificationMailer.new.sendmail(participant_id, topic_id)
      NotificationService.new(participant_id,topic,'topic').call
    end
  end

  def participant_ids(topic_id)
    TopicEveryEmailParticipantsQuery.new(topic_id).call
  end
end