summaryrefslogtreecommitdiff
path: root/app/models/ci/project.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/ci/project.rb')
-rw-r--r--app/models/ci/project.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/ci/project.rb b/app/models/ci/project.rb
index 9c9198302f6..2cf1783616f 100644
--- a/app/models/ci/project.rb
+++ b/app/models/ci/project.rb
@@ -28,9 +28,11 @@
module Ci
class Project < ActiveRecord::Base
extend Ci::Model
-
+
include Ci::ProjectStatus
+ belongs_to :gl_project, class_name: '::Project', foreign_key: :gitlab_id
+
has_many :commits, ->() { order(:committed_at) }, dependent: :destroy, class_name: 'Ci::Commit'
has_many :builds, through: :commits, dependent: :destroy, class_name: 'Ci::Build'
has_many :runner_projects, dependent: :destroy, class_name: 'Ci::RunnerProject'
@@ -90,11 +92,13 @@ module Ci
project
end
+ # TODO: remove
def from_gitlab(user, scope = :owned, options)
opts = user.authenticate_options
opts.merge! options
- projects = Ci::Network.new.projects(opts.compact, scope)
+ raise 'Implement me of fix'
+ #projects = Ci::Network.new.projects(opts.compact, scope)
if projects
projects.map { |pr| OpenStruct.new(pr) }