diff options
author | Toon Claes <toon@gitlab.com> | 2019-02-28 19:57:34 +0100 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2019-02-28 19:57:34 +0100 |
commit | 62d7990b9bb30cf33ed87017c5c633d1cccc75c2 (patch) | |
tree | c3e1b69c58a412ba1c6f50a0337a23d9f9d6e1a4 /lib/api/deployments.rb | |
parent | f6453eca992a9c142268e78ac782cef98110d183 (diff) | |
download | gitlab-ce-tc-standard-gem.tar.gz |
Ran standardrb --fix on the whole codebasetc-standard-gem
Inspired by https://twitter.com/searls/status/1101137953743613952 I
decided to try https://github.com/testdouble/standard on our codebase.
It's opinionated, but at least it's a _standard_.
Diffstat (limited to 'lib/api/deployments.rb')
-rw-r--r-- | lib/api/deployments.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/api/deployments.rb b/lib/api/deployments.rb index eb45df31ff9..6deb89a6809 100644 --- a/lib/api/deployments.rb +++ b/lib/api/deployments.rb @@ -8,34 +8,34 @@ module API before { authenticate! } params do - requires :id, type: String, desc: 'The project ID' + requires :id, type: String, desc: "The project ID" end resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do - desc 'Get all deployments of the project' do - detail 'This feature was introduced in GitLab 8.11.' + desc "Get all deployments of the project" do + detail "This feature was introduced in GitLab 8.11." success Entities::Deployment end params do use :pagination - optional :order_by, type: String, values: %w[id iid created_at ref], default: 'id', desc: 'Return deployments ordered by `id` or `iid` or `created_at` or `ref`' - optional :sort, type: String, values: %w[asc desc], default: 'asc', desc: 'Sort by asc (ascending) or desc (descending)' + optional :order_by, type: String, values: %w[id iid created_at ref], default: "id", desc: "Return deployments ordered by `id` or `iid` or `created_at` or `ref`" + optional :sort, type: String, values: %w[asc desc], default: "asc", desc: "Sort by asc (ascending) or desc (descending)" end # rubocop: disable CodeReuse/ActiveRecord - get ':id/deployments' do + get ":id/deployments" do authorize! :read_deployment, user_project present paginate(user_project.deployments.order(params[:order_by] => params[:sort])), with: Entities::Deployment end # rubocop: enable CodeReuse/ActiveRecord - desc 'Gets a specific deployment' do - detail 'This feature was introduced in GitLab 8.11.' + desc "Gets a specific deployment" do + detail "This feature was introduced in GitLab 8.11." success Entities::Deployment end params do - requires :deployment_id, type: Integer, desc: 'The deployment ID' + requires :deployment_id, type: Integer, desc: "The deployment ID" end - get ':id/deployments/:deployment_id' do + get ":id/deployments/:deployment_id" do authorize! :read_deployment, user_project deployment = user_project.deployments.find(params[:deployment_id]) |