diff --git a/app/controllers/admin/education/schools_controller.rb b/app/controllers/admin/education/schools_controller.rb index f3322b1f881bfc90dcf402ce18d9627d6a311f6e..93593ffc8f4bde0b4071a911721c42150fcea930 100644 --- a/app/controllers/admin/education/schools_controller.rb +++ b/app/controllers/admin/education/schools_controller.rb @@ -47,7 +47,7 @@ class Admin::Education::SchoolsController < Admin::Education::ApplicationControl def destroy @school.destroy_and_sync - redirect_to admin_university_schools_url, notice: t('admin.successfully_destroyed_html', model: @school.to_s) + redirect_to admin_education_schools_url, notice: t('admin.successfully_destroyed_html', model: @school.to_s) end private diff --git a/app/models/education/school/with_alumni.rb b/app/models/education/school/with_alumni.rb index 976721f5c5c34bb1068ed92716a1f5bf7ed80703..3a55dadd78b031beb661c98ef637866320462677 100644 --- a/app/models/education/school/with_alumni.rb +++ b/app/models/education/school/with_alumni.rb @@ -4,7 +4,8 @@ module Education::School::WithAlumni included do has_many :education_cohorts, - class_name: 'Education::Cohort' + class_name: 'Education::Cohort', + dependent: :destroy alias_attribute :cohorts, :education_cohorts has_many :alumni, -> { distinct },