Skip to content

Commit

Permalink
Ability to retrieve batch from a job
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcamara committed Feb 8, 2024
1 parent b3df32f commit ec2cf15
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/active_job/job_batch_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ def deserialize(job_data)
super
self.batch_id = job_data['batch_id']
end

def batch
@batch ||= SolidQueue::JobBatch.find_by(id: batch_id)
end
end
end

0 comments on commit ec2cf15

Please sign in to comment.