Verified Commit 8f5f2b89 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

fix(mission_either_one_relation_concern): two relations are also invalid

parent 589ca50d
......@@ -23,7 +23,13 @@ module MissionEitherOneRelation
private
def validate_group_assignment_or_assignment_present
errors.add(:association_insuficient) if assignment.blank? && group_assignment.blank?
if assignment.blank? && group_assignment.blank?
errors.add(:assignment, :insuficient_relation)
errors.add(:group_assignment, :insuficient_relation)
elsif assignment.present? && group_assignment.present?
errors.add(:assignment, :too_many_relations)
errors.add(:group_assignment, :too_many_relations)
end
end
end
end
......@@ -577,7 +577,8 @@ de:
semester_process_volunteer_mission:
attributes:
assignment: &id-mission-relation-insuficient
insuficient_relation: Es wird mindestens ein Assignment oder GroupAssignment benötigt.
insuficient_relation: Es wird mindestens ein Assignment oder GroupAssignment benötigt
too_many_relations: Es darf nur ein Assignment oder ein GroupAssignment verbunden werden
group_assignment: *id-mission-relation-insuficient
models:
assignment: Begleitung
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment