discourse/app/jobs/service_job.rb
Loïc Guitaut 0636855706 DEV: Allow using an AR relation as a model in services
This patch allows using an AR relation as a model in services without
fetching associated records. It will just check if the relation is empty
or not. In the former case, the execution will stop at that point, as
expected.
2024-08-20 16:32:46 +02:00

10 lines
185 B
Ruby

# frozen_string_literal: true
class ServiceJob < ::Jobs::Base
include WithServiceHelper
def run_service(service, dependencies)
@_result = service.call(dependencies)
end
end