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:
Cody Cutrer 2011-08-11 15:32:03 -06:00
parent de92627373
commit 684508158d
1 changed files with 1 additions and 1 deletions

View File

@ -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