From 25719f5a8e5f79793392c82be448ab8738469a96 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 25 Feb 2020 11:31:19 +0800 Subject: [PATCH] fix destroy categories error --- app/controllers/admin/patchfiles_controller.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/patchfiles_controller.rb b/app/controllers/admin/patchfiles_controller.rb index bf9fad7..88f98cc 100644 --- a/app/controllers/admin/patchfiles_controller.rb +++ b/app/controllers/admin/patchfiles_controller.rb @@ -19,21 +19,23 @@ class Admin::PatchfilesController < OrbitAdminController if i == 0 tags = tags.collect do |tag| tag.module_app_ids = [v.id] - tag.save + tag.save! tag end cats = cats.collect do |cat| cat.module_app_id = v.id - cat.save + cat.save! cat end auths = auths.collect do |auth| auth.module_app_id = v.id - auth.save + auth.save! auth end else v.tag_ids = [] + v.categories = nil + v.authorizations = nil v.destroy end end