Fix RfC filter for unnamed study groups

This commit is contained in:
Sebastian Serth
2021-04-09 10:25:41 +02:00
parent 1e5a9b0825
commit 1d5ceebd7b
2 changed files with 2 additions and 6 deletions

View File

@ -16,10 +16,6 @@ class StudyGroup < ApplicationRecord
end
def to_s
if name.blank?
"StudyGroup " + id.to_s
else
name
end
name.presence || "StudyGroup #{id}"
end
end

View File

@ -10,7 +10,7 @@ h1 = RequestForComment.model_name.human(count: 2)
= f.select(:solved_not_eq, [[t('request_for_comments.show_all'), 2], [t('request_for_comments.show_unsolved'), 1], [t('request_for_comments.show_solved'), 0]])
.form-group
= f.label(:submission_study_group_id_eq, t('request_for_comments.index.study_groups.placeholder'), class: 'sr-only')
= f.grouped_collection_select(:submission_study_group_id_in, @study_groups_grouping, :second, :first, :id, :name, {},
= f.grouped_collection_select(:submission_study_group_id_in, @study_groups_grouping, :second, :first, :id, :to_s, {},
{ class: 'form-control', multiple: true, "data-placeholder": t('request_for_comments.index.study_groups.placeholder') })
.table-responsive