summaryrefslogtreecommitdiff
path: root/app/presenters
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-02-28 11:49:32 -0600
committerJose Ivan Vargas <jvargas@gitlab.com>2017-03-06 09:47:44 -0600
commit43958926c5310642f2fc0c6f72952004d2ca5089 (patch)
treee22837cc90314fc245058a9c764796d48dd1df11 /app/presenters
parenta29517dd0c6515121a2f42e08ad011415a3d8618 (diff)
downloadgitlab-ce-43958926c5310642f2fc0c6f72952004d2ca5089.tar.gz
Added delegations to comply with the new rubocop rules
Also fixed the deploy_keys view and moved the code from the repository_helper to the repository_controller
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/projects/settings/deploy_keys_presenter.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/app/presenters/projects/settings/deploy_keys_presenter.rb b/app/presenters/projects/settings/deploy_keys_presenter.rb
index 25be14bd28b..86ac513b3c0 100644
--- a/app/presenters/projects/settings/deploy_keys_presenter.rb
+++ b/app/presenters/projects/settings/deploy_keys_presenter.rb
@@ -2,6 +2,9 @@ module Projects
module Settings
class DeployKeysPresenter < Gitlab::View::Presenter::Simple
presents :project
+ delegate :size, to: :enabled_keys, prefix: true
+ delegate :size, to: :available_project_keys, prefix: true
+ delegate :size, to: :available_public_keys, prefix: true
def new_key
@key ||= DeployKey.new
@@ -15,10 +18,6 @@ module Projects
enabled_keys.any?
end
- def enabled_keys_size
- enabled_keys.size
- end
-
def available_keys
@available_keys ||= current_user.accessible_deploy_keys - enabled_keys
end
@@ -31,10 +30,6 @@ module Projects
available_project_keys.any?
end
- def available_project_keys_size
- available_project_keys.size
- end
-
def key_available?(deploy_key)
available_keys.include?(deploy_key)
end
@@ -53,10 +48,6 @@ module Projects
available_public_keys.any?
end
- def available_public_keys_size
- available_public_keys.size
- end
-
def to_partial_path
'projects/deploy_keys/index'
end