Sha256: 73a46a59664f2ddbade231d7dd4efcbb01c8b52cbaa2a96ad8a5dfaa86857552

Contents?: true

Size: 414 Bytes

Versions: 7

Compression:

Stored size: 414 Bytes

Contents

# frozen_string_literal: true

if defined?(ActiveJob::Base)
  class CableReady::BroadcastJob < ActiveJob::Base
    include CableReady::Broadcaster

    def perform(identifier:, operations:, model: nil)
      if model.present?
        cable_ready[identifier.safe_constantize].apply!(operations).broadcast_to(model)
      else
        cable_ready[identifier].apply!(operations).broadcast
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cable_ready-5.0.6 app/jobs/cable_ready/broadcast_job.rb
cable_ready-5.0.3 app/jobs/cable_ready/broadcast_job.rb
cable_ready-5.0.2 app/jobs/cable_ready/broadcast_job.rb
cable_ready-5.0.1 app/jobs/cable_ready/broadcast_job.rb
cable_ready-5.0.0 app/jobs/cable_ready/broadcast_job.rb
cable_ready-5.0.0.rc2 app/jobs/cable_ready/broadcast_job.rb
cable_ready-5.0.0.rc1 app/jobs/cable_ready/broadcast_job.rb