diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-09-24 17:09:33 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-09-29 10:47:03 +0200 |
commit | 1530f68c9876bc8376bf4aa199c8abda570f5214 (patch) | |
tree | 025a0ff29e9c886a866d0e5c3362947257f75480 /app/models/ci/commit.rb | |
parent | e1b7fcedfb24353c857a160cd0c981f02fb2542a (diff) | |
download | gitlab-ce-1530f68c9876bc8376bf4aa199c8abda570f5214.tar.gz |
WIP
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 |