diff options
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r-- | app/models/ci/commit.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index f102d0a7679..31638c7e1dc 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -18,8 +18,8 @@ module Ci class Commit < ActiveRecord::Base extend Ci::Model - - belongs_to :project, class_name: 'Ci::Project' + + belongs_to :gl_project, class_name: '::Project', foreign_key: :gl_project_id has_many :builds, dependent: :destroy, class_name: 'Ci::Build' has_many :trigger_requests, dependent: :destroy, class_name: 'Ci::TriggerRequest' @@ -32,6 +32,10 @@ module Ci sha[0...8] end + def project + @project ||= gl_project.gitlab_ci_project + end + def to_param sha end |