From b84d258b5b3a5e01f946010f8a9fd87d0ced532a Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Wed, 13 Dec 2023 21:19:11 +0100 Subject: [PATCH] Avoid ArgumentError when using kwargs with delay - this was deprecated in Ruby 2.7 and breaks in Ruby 3.0, See https://github.com/collectiveidea/delayed_job/issues/1134 https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/ --- app/jobs/broadcast_request_job.rb | 4 ++-- app/models/request.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/jobs/broadcast_request_job.rb b/app/jobs/broadcast_request_job.rb index 9bf2cc749..3de2debda 100644 --- a/app/jobs/broadcast_request_job.rb +++ b/app/jobs/broadcast_request_job.rb @@ -3,13 +3,13 @@ class BroadcastRequestJob < ApplicationJob queue_as :broadcast_request - def perform(request_id:) + def perform(request_id) request = Request.where(id: request_id).first return unless request return if request.broadcasted_at.present? if request.planned? # rescheduled for future after this job was created - BroadcastRequestJob.delay(run_at: request.schedule_send_for).perform_later(request_id: request.id) + BroadcastRequestJob.delay(run_at: request.schedule_send_for).perform_later(request.id) return end diff --git a/app/models/request.rb b/app/models/request.rb index e724ce13d..d4a8480c9 100644 --- a/app/models/request.rb +++ b/app/models/request.rb @@ -63,7 +63,7 @@ def messages_by_contributor def self.broadcast!(request) if request.planned? - BroadcastRequestJob.delay(run_at: request.schedule_send_for).perform_later(request_id: request.id) + BroadcastRequestJob.delay(run_at: request.schedule_send_for).perform_later(request.id) RequestScheduled.with(request_id: request.id).deliver_later(User.all) else Contributor.active.with_tags(request.tag_list).each do |contributor|