diff --git a/app/jobs/products_quantity_check_change_job.rb b/app/jobs/products_quantity_check_change_job.rb index 87a1c80..475822f 100644 --- a/app/jobs/products_quantity_check_change_job.rb +++ b/app/jobs/products_quantity_check_change_job.rb @@ -2,7 +2,12 @@ class ProductsQuantityCheckChangeJob < ApplicationJob queue_as :default - def perform(*args) - # Do something later + def perform(val) + products = Product.all + products.each do |p| + p.chk_quantity = val + p.save + end + # TODO; send notify by action cable end end diff --git a/test/jobs/products_quantity_check_change_job_test.rb b/test/jobs/products_quantity_check_change_job_test.rb index 8c1d9bb..ff9ce13 100644 --- a/test/jobs/products_quantity_check_change_job_test.rb +++ b/test/jobs/products_quantity_check_change_job_test.rb @@ -4,4 +4,5 @@ class ProductsQuantityCheckChangeJobTest < ActiveJob::TestCase # test "the truth" do # assert true # end + end