fix destroy categories error
This commit is contained in:
parent
64d78cff2c
commit
25719f5a8e
|
@ -19,21 +19,23 @@ class Admin::PatchfilesController < OrbitAdminController
|
||||||
if i == 0
|
if i == 0
|
||||||
tags = tags.collect do |tag|
|
tags = tags.collect do |tag|
|
||||||
tag.module_app_ids = [v.id]
|
tag.module_app_ids = [v.id]
|
||||||
tag.save
|
tag.save!
|
||||||
tag
|
tag
|
||||||
end
|
end
|
||||||
cats = cats.collect do |cat|
|
cats = cats.collect do |cat|
|
||||||
cat.module_app_id = v.id
|
cat.module_app_id = v.id
|
||||||
cat.save
|
cat.save!
|
||||||
cat
|
cat
|
||||||
end
|
end
|
||||||
auths = auths.collect do |auth|
|
auths = auths.collect do |auth|
|
||||||
auth.module_app_id = v.id
|
auth.module_app_id = v.id
|
||||||
auth.save
|
auth.save!
|
||||||
auth
|
auth
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
v.tag_ids = []
|
v.tag_ids = []
|
||||||
|
v.categories = nil
|
||||||
|
v.authorizations = nil
|
||||||
v.destroy
|
v.destroy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue