gitlab-org--gitlab-foss/app/models/project_pages_metadatum.rb

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

18 lines
529 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class ProjectPagesMetadatum < ApplicationRecord
extend SuppressCompositePrimaryKeyWarning
include EachBatch
include IgnorableColumns
self.primary_key = :project_id
belongs_to :project, inverse_of: :pages_metadatum
belongs_to :pages_deployment
scope :deployed, -> { where(deployed: true) }
scope :only_on_legacy_storage, -> { deployed.where(pages_deployment: nil) }
scope :with_project_route_and_deployment, -> { preload(:pages_deployment, project: [:namespace, :route]) }
end