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

23 lines
527 B
Ruby
Raw Normal View History

2018-10-18 23:44:41 -04:00
# frozen_string_literal: true
class PoolRepository < ActiveRecord::Base
POOL_PREFIX = '@pools'
belongs_to :shard
validates :shard, presence: true
# For now, only pool repositories are tracked in the database. However, we may
# want to add other repository types in the future
self.table_name = 'repositories'
has_many :pool_member_projects, class_name: 'Project', foreign_key: :pool_repository_id
def shard_name
shard&.name
end
def shard_name=(name)
self.shard = Shard.by_name(name)
end
end