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
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-03-16 18:22:09 +0300
committerDouwe Maan <douwe@selenight.nl>2017-03-17 01:33:15 +0300
commit871bed7ac0a777d6187cbf09362c5fae441a8607 (patch)
treea0b8aa6a3dc1f487e566a062ae4ddc3f3eaf1be3 /app/services/users
parent0928d3cd82682e38c54729078afee315b000625d (diff)
Use Enumerable#index_by where possible
Diffstat (limited to 'app/services/users')
-rw-r--r--app/services/users/refresh_authorized_projects_service.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/services/users/refresh_authorized_projects_service.rb b/app/services/users/refresh_authorized_projects_service.rb
index d9370bbb598..8f6f5b937c4 100644
--- a/app/services/users/refresh_authorized_projects_service.rb
+++ b/app/services/users/refresh_authorized_projects_service.rb
@@ -93,9 +93,7 @@ module Users
end
def current_authorizations_per_project
- current_authorizations.each_with_object({}) do |row, hash|
- hash[row.project_id] = row
- end
+ current_authorizations.index_by(&:project_id)
end
def current_authorizations