summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/groups_controller.rb4
-rw-r--r--app/finders/group_children_finder.rb2
-rw-r--r--app/serializers/group_child_entity.rb3
-rw-r--r--spec/finders/group_children_finder_spec.rb4
4 files changed, 9 insertions, 4 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index d35364ffe1e..1cec83a3bc6 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -118,7 +118,9 @@ class GroupsController < Groups::ApplicationController
protected
def setup_children(parent)
- @children = GroupChildrenFinder.new(current_user, parent_group: parent, params: params).execute
+ @children = GroupChildrenFinder.new(current_user: current_user,
+ parent_group: parent,
+ params: params).execute
@children = @children.page(params[:page])
end
diff --git a/app/finders/group_children_finder.rb b/app/finders/group_children_finder.rb
index 430373a92a2..93a218ee5b3 100644
--- a/app/finders/group_children_finder.rb
+++ b/app/finders/group_children_finder.rb
@@ -3,7 +3,7 @@ class GroupChildrenFinder
attr_reader :current_user, :parent_group, :params
- def initialize(current_user = nil, parent_group:, params: {})
+ def initialize(current_user: nil, parent_group:, params: {})
@current_user = current_user
@parent_group = parent_group
@params = params
diff --git a/app/serializers/group_child_entity.rb b/app/serializers/group_child_entity.rb
index 35f5a020793..6c795da8f88 100644
--- a/app/serializers/group_child_entity.rb
+++ b/app/serializers/group_child_entity.rb
@@ -55,7 +55,8 @@ class GroupChildEntity < Grape::Entity
unless: lambda { |_instance, _options| project? }
def children_finder
- @children_finder ||= GroupChildrenFinder.new(request.current_user, parent_group: object)
+ @children_finder ||= GroupChildrenFinder.new(current_user: request.current_user,
+ parent_group: object)
end
def children_count
diff --git a/spec/finders/group_children_finder_spec.rb b/spec/finders/group_children_finder_spec.rb
index 3df153abc6a..8257e158b06 100644
--- a/spec/finders/group_children_finder_spec.rb
+++ b/spec/finders/group_children_finder_spec.rb
@@ -4,7 +4,9 @@ describe GroupChildrenFinder do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:params) { {} }
- subject(:finder) { described_class.new(user, parent_group: group, params: params) }
+ subject(:finder) do
+ described_class.new(current_user: user, parent_group: group, params: params)
+ end
before do
group.add_owner(user)