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 some code easier to read
Christophe Bliard221a006eefb0
diff --git a/app/services/api/parse_resource_params_service.rb b/app/services/api/parse_resource_params_service.rbindex 73888a8931e..4febe096449 100644--- a/app/services/api/parse_resource_params_service.rb+++ b/app/services/api/parse_resource_params_service.rb@@ -36,10 +36,10 @@ module APIself.current_user = userself.model = model- self.representer = if !representer && model- deduce_representer(model)- elsif representer+ self.representer = if representerrepresenter+ elsif model+ deduce_representer(model)elseraise 'Representer not defined'enddiff --git a/app/services/custom_actions/update_work_package_service.rb b/app/services/custom_actions/update_work_package_service.rbindex 4c6f17c0f1e..392a58bc202 100644--- a/app/services/custom_actions/update_work_package_service.rb+++ b/app/services/custom_actions/update_work_package_service.rb@@ -47,7 +47,7 @@ class CustomActions::UpdateWorkPackageServiceresult = ::WorkPackages::UpdateService.new(user: user,model: work_package)- .call(**{})+ .callblock_with_result(result, &block)enddiff --git a/lib/api/utilities/endpoints/bodied.rb b/lib/api/utilities/endpoints/bodied.rbindex 225b8c2da97..8cdb543c82b 100644--- a/lib/api/utilities/endpoints/bodied.rb+++ b/lib/api/utilities/endpoints/bodied.rb@@ -81,15 +81,16 @@ module APIenddef mount- update = self+ endpoint = self-> do- update.before_hook&.(request: self)- params = update.parse(self)- call = update.process(self, params)+ request = self # proc is executed in the context of the request+ endpoint.before_hook&.(request: request)+ params = endpoint.parse(request)+ call = endpoint.process(request, params)- update.render(self, call) do- status update.success_status+ endpoint.render(request, call) do+ status endpoint.success_statusendendend@@ -112,7 +113,7 @@ module APIprocess_service.new(**args.compact)- .with_state(request.instance_exec(**{ model: instance, params: params }, &process_state))+ .with_state(request.instance_exec(model: instance, params: params, &process_state)).call(**request.instance_exec(params, ¶ms_modifier))end