2019-12-21 20:55:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class ProjectPagesMetadatum < ApplicationRecord
|
2021-03-11 19:13:27 +05:30
|
|
|
extend SuppressCompositePrimaryKeyWarning
|
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
include EachBatch
|
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
self.primary_key = :project_id
|
|
|
|
|
|
|
|
belongs_to :project, inverse_of: :pages_metadatum
|
2020-11-24 15:15:51 +05:30
|
|
|
belongs_to :artifacts_archive, class_name: 'Ci::JobArtifact'
|
2021-01-03 14:25:43 +05:30
|
|
|
belongs_to :pages_deployment
|
2019-12-21 20:55:43 +05:30
|
|
|
|
|
|
|
scope :deployed, -> { where(deployed: true) }
|
2021-03-08 18:12:59 +05:30
|
|
|
scope :only_on_legacy_storage, -> { deployed.where(pages_deployment: nil) }
|
2021-03-11 19:13:27 +05:30
|
|
|
scope :with_project_route_and_deployment, -> { preload(:pages_deployment, project: [:namespace, :route]) }
|
2019-12-21 20:55:43 +05:30
|
|
|
end
|