Welcome to mirror list, hosted at ThFree Co, Russian Federation.

resource.rb « ci « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ee5b6546165bb47c4adde08a31468a0b771ed305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

module Ci
  class Resource < ApplicationRecord
    extend Gitlab::Ci::Model

    belongs_to :resource_group, class_name: 'Ci::ResourceGroup', inverse_of: :resources
    belongs_to :build, class_name: 'Ci::Build', inverse_of: :resource

    scope :free, -> { where(build: nil) }
    scope :retained_by, -> (build) { where(build: build) }
  end
end