Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
aoz-003
Commits
8f5f2b89
Verified
Commit
8f5f2b89
authored
Oct 05, 2018
by
Kaspar Vollenweider
👻
Browse files
fix(mission_either_one_relation_concern): two relations are also invalid
parent
589ca50d
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/concerns/mission_either_one_relation.rb
View file @
8f5f2b89
...
...
@@ -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
config/locales/de.yml
View file @
8f5f2b89
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment