debian-mirror-gitlab/app/models/packages/build_info.rb

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

13 lines
609 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
class Packages::BuildInfo < ApplicationRecord
2021-01-29 00:20:46 +05:30
belongs_to :package, inverse_of: :build_infos
2020-07-28 23:09:34 +05:30
belongs_to :pipeline, class_name: 'Ci::Pipeline'
2022-01-26 12:08:38 +05:30
scope :pluck_pipeline_ids, -> { pluck(:pipeline_id) }
scope :without_empty_pipelines, -> { where.not(pipeline_id: nil) }
scope :order_by_pipeline_id, -> (direction) { order(pipeline_id: direction) }
2022-07-16 23:28:13 +05:30
scope :with_pipeline_id_less_than, -> (pipeline_id) { where("#{table_name}.pipeline_id < ?", pipeline_id) }
scope :with_pipeline_id_greater_than, -> (pipeline_id) { where("#{table_name}.pipeline_id > ?", pipeline_id) }
2020-07-28 23:09:34 +05:30
end