child images tag adding and deleting updated.

This commit is contained in:
harrybomrah authored and saurabhbhatia committed 2013-09-05 12:51:13 +08:00
1 parent 6d8698af63
commit 131dd3fea8
1 file changed
+11 -1
@@ -195,8 +195,18 @@ class Panel::Gallery::BackEnd::AlbumsController < OrbitBackendController
end
def update_children_image_tag(tagsToDestroy,tagsToAdd)
debugger
# tagsToDestroy will contain all tag ids which have to be deleted from the galley_images
# tagsToAdd will contain all tag ids which ve to be added in tall gallery_images
@images = GalleryImage.all
@images.each do |image|
image.tagged_ids.concat(tagsToAdd)
tagsToDestroy.each do |tag|
if image.tagged_ids.include?tag
image.tagged_ids.delete(tag)
end
end
image.save
end
end
end