gitlab-org--gitlab-foss/app/models/ci/runner_namespace.rb

12 lines
388 B
Ruby
Raw Normal View History

2018-05-02 11:43:20 -04:00
module Ci
class RunnerNamespace < ActiveRecord::Base
extend Gitlab::Ci::Model
2018-05-28 07:07:28 -04:00
belongs_to :runner, inverse_of: :runner_namespaces, validate: true
belongs_to :namespace, inverse_of: :runner_namespaces, class_name: '::Namespace'
2018-05-02 11:43:20 -04:00
belongs_to :group, class_name: '::Group', foreign_key: :namespace_id
2018-05-28 08:36:47 -04:00
validates :runner_id, uniqueness: { scope: :namespace_id }
2018-05-02 11:43:20 -04:00
end
end