|
|
@ -52,6 +52,8 @@ module WorkPackage::Validations |
|
|
|
validate :validate_status_transition |
|
|
|
validate :validate_status_transition |
|
|
|
|
|
|
|
|
|
|
|
validate :validate_active_priority |
|
|
|
validate :validate_active_priority |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
validate :validate_children |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def validate_start_date_before_soonest_start_date |
|
|
|
def validate_start_date_before_soonest_start_date |
|
|
@ -103,6 +105,14 @@ module WorkPackage::Validations |
|
|
|
end |
|
|
|
end |
|
|
|
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 |
|
|
|
private |
|
|
|
|
|
|
|
|
|
|
|
def status_changed? |
|
|
|
def status_changed? |
|
|
|