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:
authorVinnie Okada <vokada@mrvinn.com>2015-02-14 23:26:08 +0300
committerVinnie Okada <vokada@mrvinn.com>2015-02-15 05:46:39 +0300
commit49d509935284c2f07c8f5cb53a31d5787c6ef7ab (patch)
tree2fd7ac3471a0050684434db38ce45914b7249f72 /app/controllers/profiles_controller.rb
parentee804e2d94018f633c6e400b443ef514b5d7a10f (diff)
Avoid duplicate application rows
Iterate over authorized applications instead of tokens to avoid multiple rows for the same authorized app.
Diffstat (limited to 'app/controllers/profiles_controller.rb')
-rw-r--r--app/controllers/profiles_controller.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb
index f7584c03411..e3e36505f0b 100644
--- a/app/controllers/profiles_controller.rb
+++ b/app/controllers/profiles_controller.rb
@@ -16,6 +16,9 @@ class ProfilesController < ApplicationController
def applications
@applications = current_user.oauth_applications
@authorized_tokens = current_user.oauth_authorized_tokens
+ @authorized_apps = @authorized_tokens.map do |token|
+ token.application
+ end.uniq
end
def update