@@ -173,8 +173,8 @@ def perform
173173 wait_for_batches_to_finish_for ( 3 . seconds )
174174 wait_for_jobs_to_finish_for ( 1 . second )
175175
176- job_batch1 = SolidQueue ::Batch . find_by ( batch_id : batch1 . batch_id )
177- job_batch2 = SolidQueue ::Batch . find_by ( batch_id : batch2 . batch_id )
176+ job_batch1 = SolidQueue ::Batch . find_by ( id : batch1 . id )
177+ job_batch2 = SolidQueue ::Batch . find_by ( id : batch2 . id )
178178
179179 assert_equal 2 , SolidQueue ::Batch . count
180180 assert_equal 2 , SolidQueue ::Batch . finished . count
@@ -232,8 +232,8 @@ def perform
232232 wait_for_batches_to_finish_for ( 3 . seconds )
233233 wait_for_jobs_to_finish_for ( 1 . second )
234234
235- job_batch1 = SolidQueue ::Batch . find_by ( batch_id : batch1 . batch_id )
236- job_batch2 = SolidQueue ::Batch . find_by ( batch_id : batch2 . batch_id )
235+ job_batch1 = SolidQueue ::Batch . find_by ( id : batch1 . id )
236+ job_batch2 = SolidQueue ::Batch . find_by ( id : batch2 . id )
237237
238238 assert_equal 2 , SolidQueue ::Batch . count
239239 assert_equal 2 , SolidQueue ::Batch . finished . count
@@ -288,7 +288,7 @@ def perform
288288 wait_for_batches_to_finish_for ( 2 . seconds )
289289 wait_for_jobs_to_finish_for ( 1 . second )
290290
291- assert_equal [ "Hi finish #{ batch . batch_id } !" , "Hi success #{ batch . batch_id } !" , "hey" ] . sort , JobBuffer . values . sort
291+ assert_equal [ "Hi finish #{ batch . id } !" , "Hi success #{ batch . id } !" , "hey" ] . sort , JobBuffer . values . sort
292292 assert_equal 1 , batch . reload . completed_jobs
293293 assert_equal 0 , batch . failed_jobs
294294 assert_equal 0 , batch . pending_jobs
@@ -299,23 +299,23 @@ class OnFinishJob < ApplicationJob
299299 queue_as :background
300300
301301 def perform ( batch )
302- JobBuffer . add "Hi finish #{ batch . batch_id } !"
302+ JobBuffer . add "Hi finish #{ batch . id } !"
303303 end
304304 end
305305
306306 class OnSuccessJob < ApplicationJob
307307 queue_as :background
308308
309309 def perform ( batch )
310- JobBuffer . add "Hi success #{ batch . batch_id } !"
310+ JobBuffer . add "Hi success #{ batch . id } !"
311311 end
312312 end
313313
314314 class OnFailureJob < ApplicationJob
315315 queue_as :background
316316
317317 def perform ( batch )
318- JobBuffer . add "Hi failure #{ batch . batch_id } !"
318+ JobBuffer . add "Hi failure #{ batch . id } !"
319319 end
320320 end
321321
@@ -330,6 +330,6 @@ def job!(active_job)
330330 end
331331
332332 def batch_jobs ( *batches )
333- SolidQueue ::Job . where ( batch_id : batches . map ( &:batch_id ) )
333+ SolidQueue ::Job . where ( id : batches . map ( &:id ) )
334334 end
335335end
0 commit comments