diff --git a/app/models/study_group.rb b/app/models/study_group.rb index 9c9a7f46..6ec12779 100644 --- a/app/models/study_group.rb +++ b/app/models/study_group.rb @@ -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 diff --git a/app/views/request_for_comments/index.html.slim b/app/views/request_for_comments/index.html.slim index c41b64f1..22c929c4 100644 --- a/app/views/request_for_comments/index.html.slim +++ b/app/views/request_for_comments/index.html.slim @@ -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