Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-01-25 20:50:09 +0300
committerGrzegorz Bizon <grzegorz@gitlab.com>2017-01-25 20:50:09 +0300
commit6cfe60df2275dace9804f4bc37b9746a9eadc6fd (patch)
tree05e401f44722603121eb196d3097879b98e0aa0c /lib
parentb55c1bc4b5fb8d259ba9f264eff607f81012fa39 (diff)
parentb368447cf7fbd090704e22311dde72cd293d9779 (diff)
Merge branch 'backport-ee-changes-for-build-minutes' into 'master'
Backport changes introduced by https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1078 See merge request !8657
Diffstat (limited to 'lib')
-rw-r--r--lib/ci/api/builds.rb2
-rw-r--r--lib/gitlab/visibility_level.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb
index c4bdef781f7..a9da8ea7eeb 100644
--- a/lib/ci/api/builds.rb
+++ b/lib/ci/api/builds.rb
@@ -23,7 +23,7 @@ module Ci
new_update = current_runner.ensure_runner_queue_value
- build = Ci::RegisterBuildService.new.execute(current_runner)
+ build = Ci::RegisterBuildService.new(current_runner).execute
if build
Gitlab::Metrics.add_event(:build_found,
diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb
index 9462f3368e6..c7953af29dd 100644
--- a/lib/gitlab/visibility_level.rb
+++ b/lib/gitlab/visibility_level.rb
@@ -11,6 +11,7 @@ module Gitlab
included do
scope :public_only, -> { where(visibility_level: PUBLIC) }
scope :public_and_internal_only, -> { where(visibility_level: [PUBLIC, INTERNAL] ) }
+ scope :non_public_only, -> { where.not(visibility_level: PUBLIC) }
scope :public_to_user, -> (user) { user && !user.external ? public_and_internal_only : public_only }
end