diff --git a/app/models/subcategory.rb b/app/models/subcategory.rb index ae4767db..9bbe7da0 100644 --- a/app/models/subcategory.rb +++ b/app/models/subcategory.rb @@ -26,8 +26,8 @@ class Subcategory < ActiveRecord::Base def create_response_rate(school:, academic_year:) student = StudentResponseRateCalculator.new(subcategory: self, school:, academic_year:) teacher = TeacherResponseRateCalculator.new(subcategory: self, school:, academic_year:) - ResponseRate.create(school:, academic_year:, subcategory: self, student_response_rate: student.rate, - teacher_response_rate: teacher.rate, meets_student_threshold: student.meets_student_threshold?, - meets_teacher_threshold: teacher.meets_teacher_threshold?) + ResponseRate.new(school:, academic_year:, subcategory: self, student_response_rate: student.rate, + teacher_response_rate: teacher.rate, meets_student_threshold: student.meets_student_threshold?, + meets_teacher_threshold: teacher.meets_teacher_threshold?) end end