summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-11-06 15:43:24 +0000
committerDouwe Maan <douwe@gitlab.com>2018-11-06 15:43:24 +0000
commit1208d55206128266690f46f0165df0fc10c24941 (patch)
tree93fbdde5a5db6cdd8f79f2806707dab093985aa2 /app/finders
parentd171ff60168cd55b6d7b9ee920269f44a26e577e (diff)
parentd0c58a97c8a053c0beec7c13c1c6ec5042120ef1 (diff)
downloadgitlab-ce-1208d55206128266690f46f0165df0fc10c24941.tar.gz
Merge branch 'master' into 'refactor-snippets-finder'refactor-snippets-finder
# Conflicts: # spec/models/project_spec.rb
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/clusters_finder.rb8
-rw-r--r--app/finders/personal_access_tokens_finder.rb2
2 files changed, 5 insertions, 5 deletions
diff --git a/app/finders/clusters_finder.rb b/app/finders/clusters_finder.rb
index b40d6c41b71..0cce493b73e 100644
--- a/app/finders/clusters_finder.rb
+++ b/app/finders/clusters_finder.rb
@@ -1,20 +1,20 @@
# frozen_string_literal: true
class ClustersFinder
- def initialize(project, user, scope)
- @project = project
+ def initialize(clusterable, user, scope)
+ @clusterable = clusterable
@user = user
@scope = scope || :active
end
def execute
- clusters = project.clusters
+ clusters = clusterable.clusters
filter_by_scope(clusters)
end
private
- attr_reader :project, :user, :scope
+ attr_reader :clusterable, :user, :scope
def filter_by_scope(clusters)
case scope.to_sym
diff --git a/app/finders/personal_access_tokens_finder.rb b/app/finders/personal_access_tokens_finder.rb
index 81fd3b7a547..bd95dcd323f 100644
--- a/app/finders/personal_access_tokens_finder.rb
+++ b/app/finders/personal_access_tokens_finder.rb
@@ -3,7 +3,7 @@
class PersonalAccessTokensFinder
attr_accessor :params
- delegate :build, :find, :find_by, :find_by_token, to: :execute
+ delegate :build, :find, :find_by_id, :find_by_token, to: :execute
def initialize(params = {})
@params = params