debian-mirror-gitlab/app/models/preloaders/runner_manager_policy_preloader.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
512 B
Ruby
Raw Normal View History

2023-06-20 00:43:36 +05:30
# frozen_string_literal: true
module Preloaders
class RunnerManagerPolicyPreloader
def initialize(runner_managers, current_user)
@runner_managers = runner_managers
@current_user = current_user
end
def execute
return if runner_managers.is_a?(ActiveRecord::NullRelation)
ActiveRecord::Associations::Preloader.new(
records: runner_managers,
associations: [:runner]
).call
end
private
attr_reader :runner_managers, :current_user
end
end