diff --git a/app/controllers/admin/patchfiles_controller.rb b/app/controllers/admin/patchfiles_controller.rb index 52c07ce..5f62512 100644 --- a/app/controllers/admin/patchfiles_controller.rb +++ b/app/controllers/admin/patchfiles_controller.rb @@ -16,6 +16,7 @@ class Admin::PatchfilesController < OrbitAdminController cats = array_vs.collect{|v| v.categories}.flatten.uniq tags = array_vs.collect{|v| v.tags}.flatten.uniq auths = array_vs.collect{|v| v.authorizations}.flatten.uniq + hashtags = array_vs.collect{|v| v.hashtags.to_a}.flatten.uniq array_vs.reverse.each_with_index do |v,i| if i == 0 tags = tags.collect do |tag| @@ -33,10 +34,16 @@ class Admin::PatchfilesController < OrbitAdminController auth.save! auth end + hashtags.each do |hashtag| + hashtag.module_app_ids = (hashtag.module_app_ids - array_vs.map(&:id) + [v.id]).uniq + hashtag.save! + end else v.tag_ids = [] v.categories = nil v.authorizations = nil + v.hashtag_ids = [] + v.save! v.destroy end end @@ -253,4 +260,4 @@ class Admin::PatchfilesController < OrbitAdminController end end end -end \ No newline at end of file +end