child images tag adding and deleting updated.

This commit is contained in:
Harry Bomrah 2013-09-04 13:10:09 +08:00 committed by saurabhbhatia
parent 6d8698af63
commit 131dd3fea8
1 changed files with 11 additions and 1 deletions

View File

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