Skip to content

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

refactor: inline call

Christophe Bliard2e2767e7f207
diff --git a/app/services/work_packages/set_attributes_service.rb b/app/services/work_packages/set_attributes_service.rb
index e29ff6a5ae4..862734a01bf 100644
--- a/app/services/work_packages/set_attributes_service.rb
+++ b/app/services/work_packages/set_attributes_service.rb
@@ -51,14 +51,13 @@ class WorkPackages::SetAttributesService < ::BaseServices::SetAttributes
end
def set_calculated_attributes(attributes)
- derivable = derivable_attribute
if work_package.new_record?
set_default_attributes(attributes)
else
update_dates
end
update_duration
- update_derivable(derivable)
+ update_derivable
update_project_dependent_attributes
reassign_invalid_status_if_type_changed
set_templated_description
@@ -130,8 +129,8 @@ class WorkPackages::SetAttributesService < ::BaseServices::SetAttributes
end
# rubocop:disable Metrics/AbcSize
- def update_derivable(derivable)
- case derivable
+ def update_derivable
+ case derivable_attribute
when :duration
work_package.duration =
if work_package.milestone?