summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-08-11 17:26:04 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-08-11 17:26:04 +0800
commit4b559c9afb34b80b910efec514653c6ea65adba8 (patch)
tree7470c474011876afc98770617c22eec0b1dbe3b4 /app/models/project.rb
parent517249858e41694f51b67461b313d5a34c2a466c (diff)
downloadgitlab-ce-4b559c9afb34b80b910efec514653c6ea65adba8.tar.gz
Reverse ref and sha in args and rename pipeline to pipeline_for
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index d306f86f783..dc9b4b38a10 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1086,12 +1086,13 @@ class Project < ActiveRecord::Base
!namespace.share_with_group_lock
end
- def pipeline(sha, ref)
+ def pipeline_for(ref, sha)
pipelines.order(id: :desc).find_by(sha: sha, ref: ref)
end
- def ensure_pipeline(sha, ref, current_user = nil)
- pipeline(sha, ref) || pipelines.create(sha: sha, ref: ref, user: current_user)
+ def ensure_pipeline(ref, sha, current_user = nil)
+ pipeline_for(ref, sha) ||
+ pipelines.create(sha: sha, ref: ref, user: current_user)
end
def enable_ci