diff options
author | Regis <boudinot.regis@yahoo.com> | 2016-12-16 09:50:23 -0700 |
---|---|---|
committer | Regis <boudinot.regis@yahoo.com> | 2016-12-16 09:50:23 -0700 |
commit | 211ee4b97c0754f30ff018d9a333e72559661a05 (patch) | |
tree | c97c0c517ca205d30629d337669a9870ca7752ed /app/models/commit.rb | |
parent | 27a4aef5848d36b38c861c952a098f85562a31df (diff) | |
parent | ae71032d0af1730c359089f3edc9029a8b5c8acc (diff) | |
download | gitlab-ce-211ee4b97c0754f30ff018d9a333e72559661a05.tar.gz |
Merge branch 'master' into auto-pipelines-vue
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 1831cc7e175..69cfc47f5bf 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -228,13 +228,9 @@ class Commit def status(ref = nil) @statuses ||= {} - if @statuses.key?(ref) - @statuses[ref] - elsif ref - @statuses[ref] = pipelines.where(ref: ref).status - else - @statuses[ref] = pipelines.status - end + return @statuses[ref] if @statuses.key?(ref) + + @statuses[ref] = pipelines.latest_status(ref) end def revert_branch_name @@ -270,7 +266,7 @@ class Commit @merged_merge_request_hash ||= Hash.new do |hash, user| hash[user] = merged_merge_request_no_cache(user) end - + @merged_merge_request_hash[current_user] end |