Skip to content

Commit f01dd8e

Browse files
committed
Only destroy the school if it exists
The previous commit caused of the for education tests to fail as it was trying to destroy a school that didn't exist. This might have been the cause of the intermittent failures as previously if the school didn't exist (but other data did) it would rollback and restore the other data.
1 parent 48e7ef2 commit f01dd8e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/tasks/for_education.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace :for_education do
3838
SchoolClass.where(id: [school_class_ids]).destroy_all
3939

4040
# Destroy the school
41-
School.find(school_id).destroy
41+
School.where(id: school_id).destroy_all
4242

4343
Rails.logger.info 'Done...'
4444
end

0 commit comments

Comments
 (0)