summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2014-12-29 09:04:31 +0100
committerMarin Jankovski <maxlazio@gmail.com>2014-12-29 09:04:31 +0100
commit1c089a8561556377dccbf661a3016cac2329c713 (patch)
tree90622a75e52eea147bf0796c5518b9f948f2ee16 /app/models/project.rb
parent78865a0c993f72c470e67ccb40f7b8d87ad50878 (diff)
downloadgitlab-ce-1c089a8561556377dccbf661a3016cac2329c713.tar.gz
Use shorter search for protected branch status.
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 80f1c0d598a..40b3412c654 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -471,7 +471,7 @@ class Project < ActiveRecord::Base
end
def developers_can_push_to_protected_branch?(branch_name)
- protected_branches.map{ |pb| pb.developers_can_push if pb.name == branch_name }.compact.first
+ protected_branches.any? { |pb| pb.name == branch_name && pb.developers_can_push }
end
def forked?