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 5, 2024
1 parent cc2d1e3 commit aa2558c
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 aa2558c

Please sign in to comment.