summaryrefslogtreecommitdiff
path: root/app/presenters
diff options
context:
space:
mode:
authorJacob Schatz <jschatz1@gmail.com>2017-04-27 16:40:27 -0400
committerJacob Schatz <jschatz1@gmail.com>2017-04-27 16:40:27 -0400
commit57f8be4e69acea24456758d2888e0f703a2dfba9 (patch)
treedacb22153c3e72321161ebf2e5fc438e1e942a95 /app/presenters
parent5976195fef53fe1bc56647dfc06049a8f984d5fe (diff)
parent703df2881bb137a79284baafe2cc12ff32ab9ff5 (diff)
downloadgitlab-ce-57f8be4e69acea24456758d2888e0f703a2dfba9.tar.gz
Merge remote-tracking branch 'origin/29667-deploy-keys' into deploy-keys-load-async
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/projects/settings/deploy_keys_presenter.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/presenters/projects/settings/deploy_keys_presenter.rb b/app/presenters/projects/settings/deploy_keys_presenter.rb
index 86ac513b3c0..070b0c35e36 100644
--- a/app/presenters/projects/settings/deploy_keys_presenter.rb
+++ b/app/presenters/projects/settings/deploy_keys_presenter.rb
@@ -48,6 +48,17 @@ module Projects
available_public_keys.any?
end
+ def as_json
+ serializer = DeployKeySerializer.new
+ opts = { user: current_user }
+
+ {
+ enabled_keys: serializer.represent(enabled_keys, opts),
+ available_project_keys: serializer.represent(available_project_keys, opts),
+ public_keys: serializer.represent(available_public_keys, opts)
+ }
+ end
+
def to_partial_path
'projects/deploy_keys/index'
end