OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Make rubocop happier
Christophe Bliard4f6e52116fc8
diff --git a/lib/api/v3/utilities/endpoints/index.rb b/lib/api/v3/utilities/endpoints/index.rbindex 016745b27a7..529094b8869 100644--- a/lib/api/v3/utilities/endpoints/index.rb+++ b/lib/api/v3/utilities/endpoints/index.rb@@ -61,7 +61,7 @@ module APIif query.valid?render_success(query,request.params,- self_path.respond_to?(:call) ? request.instance_exec(&self_path) : request.api_v3_paths.send(self_path),+ resolved_self_path,scope ? request.instance_exec(&scope) : model)elserender_error(query)@@ -106,6 +106,10 @@ module APIcurrent_user: User.current)end+ def resolved_self_path+ self_path.respond_to?(:call) ? request.instance_exec(&self_path) : request.api_v3_paths.send(self_path)+ end+def calculate_resulting_params(query, provided_params)calculate_default_params(query).merge(provided_params.slice('offset', 'pageSize').symbolize_keys).tap do |params|params[:offset] = to_i_or_nil(params[:offset])diff --git a/modules/storages/spec/lib/api/v3/file_links/file_link_representer_rendering_spec.rb b/modules/storages/spec/lib/api/v3/file_links/file_link_representer_rendering_spec.rbindex 65520984b58..3540403c10b 100644--- a/modules/storages/spec/lib/api/v3/file_links/file_link_representer_rendering_spec.rb+++ b/modules/storages/spec/lib/api/v3/file_links/file_link_representer_rendering_spec.rb@@ -45,14 +45,14 @@ describe ::API::V3::FileLinks::FileLinkRepresenter, 'rendering' doenddescribe '_links' do- context 'self' do+ describe 'self' doit_behaves_like 'has an untitled link' dolet(:link) { 'self' }let(:href) { "/api/v3/work_packages/#{container.id}/file_links/#{file_link.id}" }endend- context 'storage' do+ describe 'storage' doit_behaves_like 'has a titled link' dolet(:link) { 'storage' }let(:href) { "/api/v3/storages/#{storage.id}" }@@ -60,7 +60,7 @@ describe ::API::V3::FileLinks::FileLinkRepresenter, 'rendering' doendend- context 'container' do+ describe 'container' doit_behaves_like 'has a titled link' dolet(:link) { 'container' }let(:href) { "/api/v3/work_packages/#{container.id}" }@@ -68,7 +68,7 @@ describe ::API::V3::FileLinks::FileLinkRepresenter, 'rendering' doendend- context 'creator' do+ describe 'creator' doit_behaves_like 'has a titled link' dolet(:link) { 'creator' }let(:href) { "/api/v3/users/#{creator.id}" }@@ -76,7 +76,7 @@ describe ::API::V3::FileLinks::FileLinkRepresenter, 'rendering' doendend- context 'delete' do+ describe 'delete' dolet(:permission) { :manage_file_links }it_behaves_like 'has an untitled action link' do@@ -86,14 +86,14 @@ describe ::API::V3::FileLinks::FileLinkRepresenter, 'rendering' doendend- context 'originOpen' do+ describe 'originOpen' doit_behaves_like 'has an untitled link' dolet(:link) { 'originOpen' }let(:href) { "#{storage.host}/f/#{file_link.origin_id}" }endend- context 'staticOriginOpen' do+ describe 'staticOriginOpen' doit_behaves_like 'has an untitled link' dolet(:link) { 'staticOriginOpen' }let(:href) { "/api/v3/work_packages/#{container.id}/file_links/#{file_link.id}/open" }@@ -118,7 +118,7 @@ describe ::API::V3::FileLinks::FileLinkRepresenter, 'rendering' dolet(:value) { file_link.updated_at }end- context 'originData' do+ describe 'originData' doit_behaves_like 'property', 'originData/id' dolet(:value) { file_link.origin_id }end