Use ActiveJob instead of Resque directly
This allows us to directly pass entities to the job.
This commit is contained in:
parent
07c8393c8c
commit
47d9c79617
16 changed files with 76 additions and 73 deletions
11
app/jobs/notify_negative_balance_job.rb
Normal file
11
app/jobs/notify_negative_balance_job.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class NotifyNegativeBalanceJob < ApplicationJob
|
||||
def perform(ordergroup, transaction)
|
||||
ordergroup.users.each do |user|
|
||||
next unless user.settings.notify['negative_balance']
|
||||
|
||||
Mailer.deliver_now_with_user_locale user do
|
||||
Mailer.negative_balance(user, transaction)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue