fix destroy categories error

This commit is contained in:
chiu 2020-02-25 11:31:19 +08:00
parent 64d78cff2c
commit 25719f5a8e
1 changed files with 5 additions and 3 deletions

View File

@ -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