Show nice name for StudyGroups

This commit is contained in:
Sebastian Serth
2019-01-15 17:36:57 +01:00
parent d45dc04a3e
commit 7eab61dc8f

View File

@ -8,4 +8,12 @@ class StudyGroup < ApplicationRecord
has_many :users, through: :study_group_memberships, source_type: 'ExternalUser'
has_many :submissions
belongs_to :consumer
def to_s
if name.blank?
"StudyGroup " + id.to_s
else
name
end
end
end