fix mass assignment bug
Change-Id: I95443fe6d74fd75a7cb590b65604b9ec410ce3fe Reviewed-on: https://gerrit.instructure.com/5057 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: JT Olds <jt@instructure.com>
This commit is contained in:
parent
de92627373
commit
684508158d
|
@ -868,7 +868,7 @@ class Course < ActiveRecord::Base
|
|||
@enrollment_lookup ||= {}
|
||||
@enrollment_lookup[user.id] ||=
|
||||
if session && temp_type = session["role_course_#{self.id}"]
|
||||
[Enrollment.typed_enrollment(temp_type).new(:course_id => self.id, :user_id => user.id, :workflow_state => 'active')] rescue nil
|
||||
[Enrollment.typed_enrollment(temp_type).new(:course => self, :user => user, :workflow_state => 'active')]
|
||||
else
|
||||
self.enrollments.active_or_pending.for_user(user)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue