debian-mirror-gitlab/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

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
2022-05-07 20:08:51 +05:30
include IgnorableColumns
2021-03-08 18:12:59 +05:30
2019-12-21 20:55:43 +05:30
self.primary_key = :project_id
belongs_to :project, inverse_of: :pages_metadatum
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