debian-mirror-gitlab/app/models/ci/runner_namespace.rb

14 lines
419 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2018-10-15 14:42:47 +05:30
module Ci
class RunnerNamespace < ActiveRecord::Base
extend Gitlab::Ci::Model
2018-11-08 19:23:39 +05:30
belongs_to :runner, inverse_of: :runner_namespaces, validate: true
belongs_to :namespace, inverse_of: :runner_namespaces, class_name: '::Namespace'
2018-10-15 14:42:47 +05:30
belongs_to :group, class_name: '::Group', foreign_key: :namespace_id
2018-11-08 19:23:39 +05:30
validates :runner_id, uniqueness: { scope: :namespace_id }
2018-10-15 14:42:47 +05:30
end
end