Skip to content

Commit 9cdcb1a

Browse files
author
Ryan Florence
committed
Fixes #5978 - Missing Courses in Menu
We started hiding enrollments where the created_at and updated_at fields were identical, assuming it was SIS garbage data. Turns out we were wrong. Reverting. Change-Id: I9a479ea5f1ffde61365ab15aa36975e865be4e74 Reviewed-on: https://gerrit.instructure.com/6241 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: Brian Palmer <brianp@instructure.com>
1 parent b05c932 commit 9cdcb1a

3 files changed

Lines changed: 0 additions & 26 deletions

File tree

app/models/user.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,9 +1913,6 @@ def set_menu_data(enrollment_uuid)
19131913
cached_enrollments = self.cached_current_enrollments(:include_enrollment_uuid => enrollment_uuid)
19141914
cached_enrollments.each do |e|
19151915

1916-
# SIS "garbage" data, user auto-enrolled but has never done anything with it
1917-
next if e.updated_at == e.created_at
1918-
19191916
next if e.state_based_on_date == :inactive
19201917

19211918
if e.state_based_on_date == :completed

spec/integration/enrollment_date_restrictions_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
e2.state.should == :active
3434
e2.state_based_on_date.should == :inactive
3535

36-
Enrollment.update_all(["created_at = ?", 1.minute.ago]) # need to make created_at and updated_at different
37-
3836
user_session(@student, @pseudonym)
3937

4038
get "/"
@@ -68,8 +66,6 @@
6866
@group2 = @course2.groups.create(:name => "Group 1")
6967
@group2.add_user(@student)
7068

71-
Enrollment.update_all(["created_at = ?", 1.minute.ago]) # need to make created_at and updated_at different
72-
7369
user_session(@student, @pseudonym)
7470

7571
get "/"

spec/integration/navigation_spec.rb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,4 @@
5656
get "/"
5757
response.should be_success
5858
end
59-
60-
it "should not show enrollments with identical created_at and updated_at dates (bad SIS data)" do
61-
@account = Account.default
62-
user_with_pseudonym
63-
64-
course_with_teacher(:course_name => "Course 1", :user => @user)
65-
@enrollment = course_with_teacher(:course_name => "Course 2", :user => @user)
66-
67-
Enrollment.update_all(["updated_at = ?", @enrollment.created_at], :id => @enrollment.id)
68-
69-
user_session(@user, @pseudonym)
70-
71-
get "/"
72-
page = Nokogiri::HTML(response.body)
73-
list = page.css(".menu-item-drop-column-list li")
74-
list.length.should == 2
75-
end
7659
end
77-
78-

0 commit comments

Comments
 (0)