2019-09-25 09:06:04 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class ProjectPagesMetadatum < ApplicationRecord
|
2021-01-27 12:09:01 +00:00
|
|
|
extend SuppressCompositePrimaryKeyWarning
|
|
|
|
|
2020-12-23 06:10:22 +00:00
|
|
|
include EachBatch
|
|
|
|
|
2019-09-25 09:06:04 +00:00
|
|
|
self.primary_key = :project_id
|
|
|
|
|
|
|
|
belongs_to :project, inverse_of: :pages_metadatum
|
2020-08-31 18:10:43 +00:00
|
|
|
belongs_to :artifacts_archive, class_name: 'Ci::JobArtifact'
|
2020-10-12 18:08:31 +00:00
|
|
|
belongs_to :pages_deployment
|
2019-09-25 09:06:04 +00:00
|
|
|
|
|
|
|
scope :deployed, -> { where(deployed: true) }
|
2020-12-23 06:10:22 +00:00
|
|
|
scope :only_on_legacy_storage, -> { deployed.where(pages_deployment: nil) }
|
2021-01-26 15:08:58 +00:00
|
|
|
scope :with_project_route_and_deployment, -> { preload(:pages_deployment, project: [:namespace, :route]) }
|
2019-09-25 09:06:04 +00:00
|
|
|
end
|