From 4b326a9a0ae0ba2d7c918953540fa0174a1d1460 Mon Sep 17 00:00:00 2001 From: James Smith Date: Thu, 5 Sep 2024 12:07:27 +0100 Subject: [PATCH] fix bulk update find --- app/controllers/models_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/models_controller.rb b/app/controllers/models_controller.rb index 753558445..21edd96df 100644 --- a/app/controllers/models_controller.rb +++ b/app/controllers/models_controller.rb @@ -130,7 +130,7 @@ def bulk_update add_tags = Set.new(hash.delete(:add_tags)) remove_tags = Set.new(hash.delete(:remove_tags)) ids = params[:models].select { |k, v| v == "1" }.keys - policy_scope(Model).find(ids).each do |model| + policy_scope(Model).where(public_id: ids).find_each do |model| if model&.update(hash) existing_tags = Set.new(model.tag_list) model.tag_list = existing_tags + add_tags - remove_tags