diff --git a/app/models/work_package/validations.rb b/app/models/work_package/validations.rb index 4cf566e134..22979661c4 100644 --- a/app/models/work_package/validations.rb +++ b/app/models/work_package/validations.rb @@ -52,6 +52,8 @@ module WorkPackage::Validations validate :validate_status_transition validate :validate_active_priority + + validate :validate_children end def validate_start_date_before_soonest_start_date @@ -103,6 +105,14 @@ module WorkPackage::Validations end end + def validate_children + children.select { |c| !c.valid? }.each do |child| + child.errors.each do |_, value| + errors.add(:"##{child.id}", value) + end + end + end + private def status_changed?