Skip to content

Commit

Permalink
fix bulk update find
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Sep 5, 2024
1 parent 4615594 commit 4b326a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/models_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4b326a9

Please sign in to comment.