diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb index bfb158a73..5ac21b808 100644 --- a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/albums_controller.rb @@ -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