Sha256: 20ba69e3d8222d1c5df364ffff665647427c72a630aeb994638f76ed8a6c0f82

Contents?: true

Size: 421 Bytes

Versions: 5

Compression:

Stored size: 421 Bytes

Contents

# frozen_string_literal: true
module Timeful
  # Creates a feed item for each subscriber of the activity.
  #
  # @author Alessandro Desantis
  class DeliverActivityToSubscribersJob < ActiveJob::Base
    queue_as { Timeful.jobs_queue }

    def perform(activity)
      RelationProxy.new(activity.subscribers).find_each do |subscriber|
        subscriber.feed_items.create!(activity: activity)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
timeful-2.1.0 app/jobs/timeful/deliver_activity_to_subscribers_job.rb
timeful-2.0.0 app/jobs/timeful/deliver_activity_to_subscribers_job.rb
timeful-1.1.0 app/jobs/timeful/deliver_activity_to_subscribers_job.rb
timeful-1.0.0 app/jobs/timeful/deliver_activity_to_subscribers_job.rb
timeful-0.0.1 app/jobs/timeful/deliver_activity_to_subscribers_job.rb