From 684508158db17fc555870742d37bcf520f7463f8 Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Thu, 11 Aug 2011 15:32:03 -0600 Subject: [PATCH] fix mass assignment bug Change-Id: I95443fe6d74fd75a7cb590b65604b9ec410ce3fe Reviewed-on: https://gerrit.instructure.com/5057 Tested-by: Hudson Reviewed-by: JT Olds --- app/models/course.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/course.rb b/app/models/course.rb index 76cecdf669e..ea3d9981cd8 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -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