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
convert passed remaining hours string value to the right hour format
Behrokh Satarnejad14903b8b4295
diff --git a/app/models/work_package.rb b/app/models/work_package.rbindex d873070c3e9..e7a2ed46fc1 100644--- a/app/models/work_package.rb+++ b/app/models/work_package.rb@@ -310,6 +310,11 @@ class WorkPackage < ApplicationRecordwrite_attribute :estimated_hours, !!converted_hours ? converted_hours : hoursend+ def remaining_hours=(hours)+ converted_hours = (hours.is_a?(String) ? hours.to_hours : hours)+ write_attribute :remaining_hours, !!converted_hours ? converted_hours : hours+ end+def duration_in_hoursduration ? duration * 24 : nilend