debian-mirror-gitlab/app/models/ci/build_need.rb

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

17 lines
507 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
module Ci
2021-10-27 15:23:28 +05:30
class BuildNeed < Ci::ApplicationRecord
2020-07-28 23:09:34 +05:30
include BulkInsertSafe
2021-06-08 01:23:25 +05:30
2021-03-08 18:12:59 +05:30
belongs_to :build, class_name: "Ci::Processable", foreign_key: :build_id, inverse_of: :needs
2019-10-12 21:52:04 +05:30
validates :build, presence: true
validates :name, presence: true, length: { maximum: 128 }
2021-04-17 20:07:23 +05:30
validates :optional, inclusion: { in: [true, false] }
2019-10-12 21:52:04 +05:30
scope :scoped_build, -> { where('ci_builds.id=ci_build_needs.build_id') }
2020-01-01 13:55:28 +05:30
scope :artifacts, -> { where(artifacts: true) }
2019-10-12 21:52:04 +05:30
end
end