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

23 lines
550 B
Ruby
Raw Normal View History

2015-09-25 12:07:36 +05:30
# == Schema Information
#
2015-11-26 14:37:03 +05:30
# Table name: ci_runner_projects
2015-09-25 12:07:36 +05:30
#
# id :integer not null, primary key
# runner_id :integer not null
# project_id :integer
# created_at :datetime
# updated_at :datetime
# gl_project_id :integer
2015-09-25 12:07:36 +05:30
#
module Ci
class RunnerProject < ActiveRecord::Base
extend Ci::Model
belongs_to :runner, class_name: 'Ci::Runner'
2015-12-23 02:04:40 +05:30
belongs_to :project, class_name: '::Project', foreign_key: :gl_project_id
2015-09-25 12:07:36 +05:30
2015-12-23 02:04:40 +05:30
validates_uniqueness_of :runner_id, scope: :gl_project_id
2015-09-25 12:07:36 +05:30
end
end