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
Renaming return value from service to service_result
Wieland Lindenthalc860b5df4281
diff --git a/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb b/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rbindex 61706953edf..f60a2d1267c 100644--- a/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb+++ b/modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb@@ -106,24 +106,24 @@ module Bimifc_model = Bim::IfcModels::IfcModel.find_by id: session[:pending_ifc_model_ifc_model_id]new_model = false- call = ::Bim::IfcModels::UpdateService+ service_result = ::Bim::IfcModels::UpdateService.new(user: current_user, model: ifc_model).call(params.with_indifferent_access)- @ifc_model = call.result+ @ifc_model = service_result.resultelse- call = ::Bim::IfcModels::CreateService+ service_result = ::Bim::IfcModels::CreateService.new(user: current_user).call(params.with_indifferent_access)- @ifc_model = call.result+ @ifc_model = service_result.resultendsession.delete :pending_ifc_model_titlesession.delete :pending_ifc_model_is_defaultsession.delete :pending_ifc_model_ifc_model_id- if call.success?+ if service_result.success?::Attachments::FinishDirectUploadJob.perform_later attachment.idif new_model@@ -136,7 +136,7 @@ module Bimelseattachment.destroy- flash[:error] = call.errors.full_messages.join(" ")+ flash[:error] = service_result.errors.full_messages.join(" ")redirect_to action: :newend@@ -147,17 +147,17 @@ module Bim.to_h.reverse_merge(project: @project)- call = ::Bim::IfcModels::CreateService+ service_result = ::Bim::IfcModels::CreateService.new(user: current_user).call(combined_params)- @ifc_model = call.result+ @ifc_model = service_result.result- if call.success?+ if service_result.success?flash[:notice] = t('ifc_models.flash_messages.upload_successful')redirect_to action: :indexelse- @errors = call.errors+ @errors = service_result.errorsrender action: :newendend@@ -167,17 +167,17 @@ module Bim.to_h.reverse_merge(project: @project)- call = ::Bim::IfcModels::UpdateService+ service_result = ::Bim::IfcModels::UpdateService.new(user: current_user, model: @ifc_model).call(combined_params)- @ifc_model = call.result+ @ifc_model = service_result.result- if call.success?+ if service_result.success?flash[:notice] = t(:notice_successful_update)redirect_to action: :indexelse- @errors = call.errors+ @errors = service_result.errorsrender action: :editendenddiff --git a/modules/bim/app/services/bim/ifc_models/update_service.rb b/modules/bim/app/services/bim/ifc_models/update_service.rbindex d3f66fed662..a3f9258ac67 100644--- a/modules/bim/app/services/bim/ifc_models/update_service.rb+++ b/modules/bim/app/services/bim/ifc_models/update_service.rb@@ -32,23 +32,23 @@ module Bimprotecteddef before_perform(params)- super.tap do |call|- @ifc_attachment_replaced = call.success? && model.ifc_attachment.new_record?+ super.tap do |_service_result|+ @ifc_attachment_replaced = model.ifc_attachment.new_record?endend- def after_perform(call)- if call.success?+ def after_perform(service_result)+ if service_result.success?# As the attachments association does not have the autosave option, we need to remove the# attachments ourselvesmodel.attachments.select(&:marked_for_destruction?).each(&:destroy)if @ifc_attachment_replaced- IfcConversionJob.perform_later(call.result)+ IfcConversionJob.perform_later(service_result.result)endend- call+ service_resultendendend