fix destroy categories error
This commit is contained in:
parent
64d78cff2c
commit
25719f5a8e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue