Allow internal users to switch their current study group
This commit is contained in:
@ -37,8 +37,4 @@ class InternalUser < User
|
|||||||
def displayname
|
def displayname
|
||||||
name
|
name
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_study_group_id
|
|
||||||
study_groups.find_by(external_id: nil)&.id
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -30,7 +30,7 @@ FactoryBot.define do
|
|||||||
end
|
end
|
||||||
|
|
||||||
user.study_group_memberships.update(role: 'teacher') if evaluator.teacher_in_study_group
|
user.study_group_memberships.update(role: 'teacher') if evaluator.teacher_in_study_group
|
||||||
user.store_current_study_group_id(user.study_group_memberships.first)
|
user.store_current_study_group_id(user.study_group_memberships.first.study_group_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user