mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Ensure all Job classes correctly inherit from ActiveJob
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
class HeartbeatJob
|
||||
# frozen_string_literal: true
|
||||
|
||||
class HeartbeatJob < ActiveJob::Base
|
||||
def perform
|
||||
Spree::Config.last_job_queue_heartbeat_at = Time.now.in_time_zone
|
||||
end
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
ManagerInvitationJob = Struct.new(:enterprise_id, :user_id) do
|
||||
def perform
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ManagerInvitationJob < ActiveJob::Base
|
||||
def perform(enterprise_id, user_id)
|
||||
enterprise = Enterprise.find enterprise_id
|
||||
user = Spree::User.find user_id
|
||||
EnterpriseMailer.manager_invitation(enterprise, user).deliver_now
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require 'order_management/subscriptions/summarizer'
|
||||
|
||||
# Confirms orders of unconfirmed proxy orders in recently closed Order Cycles
|
||||
class SubscriptionConfirmJob
|
||||
class SubscriptionConfirmJob < ActiveJob::Base
|
||||
def perform
|
||||
confirm_proxy_orders!
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require 'order_management/subscriptions/summarizer'
|
||||
|
||||
class SubscriptionPlacementJob
|
||||
class SubscriptionPlacementJob < ActiveJob::Base
|
||||
def perform
|
||||
ids = proxy_orders.pluck(:id)
|
||||
proxy_orders.update_all(placed_at: Time.zone.now)
|
||||
|
||||
Reference in New Issue
Block a user