Sha256: d22e0eac5d909d3ce8c701886a6bf5ae146008fe8f77cb46929e7d8fd0521f8b

Contents?: true

Size: 447 Bytes

Versions: 9

Compression:

Stored size: 447 Bytes

Contents

# frozen_string_literal: true

class CableReadyBroadcastJob < (defined?(ActiveJob::Base) ? ActiveJob::Base : Object)
  include CableReady::Broadcaster
  queue_as :default if defined?(ActiveJob::Base)

  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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cable_ready-5.0.0.pre9 app/jobs/cable_ready_broadcast_job.rb
cable_ready-5.0.0.pre8 app/jobs/cable_ready_broadcast_job.rb
cable_ready-5.0.0.pre7 app/jobs/cable_ready_broadcast_job.rb
cable_ready-5.0.0.pre6 app/jobs/cable_ready_broadcast_job.rb
cable_ready-5.0.0.pre5 app/jobs/cable_ready_broadcast_job.rb
cable_ready-5.0.0.pre4 app/jobs/cable_ready_broadcast_job.rb
cable_ready-5.0.0.pre3 app/jobs/cable_ready_broadcast_job.rb
cable_ready-5.0.0.pre2 app/jobs/cable_ready_broadcast_job.rb
cable_ready-5.0.0.pre1 app/jobs/cable_ready_broadcast_job.rb