diff --git a/lib/sis/enrollment_importer.rb b/lib/sis/enrollment_importer.rb index 78fdc915b9d..e0e12224a2d 100644 --- a/lib/sis/enrollment_importer.rb +++ b/lib/sis/enrollment_importer.rb @@ -44,10 +44,12 @@ module SIS end # We batch these up at the end because we don't want to keep touching the same course over and over, # and to avoid hitting other callbacks for the course (especially broadcast_policy) - i.courses_to_touch_ids.to_a.in_groups_of(1000, false) do |batch| - courses = Course.where(id: batch) - courses.touch_all - courses.each(&:recache_grade_distribution) + if Course.method_defined?(:recache_grade_distribution) + i.courses_to_touch_ids.to_a.in_groups_of(1000, false) do |batch| + courses = Course.where(id: batch) + courses.touch_all + courses.each(&:recache_grade_distribution) + end end i.courses_to_recache_due_dates.to_a.in_groups_of(1000, false) do |batch| batch.each do |course_id, user_ids|