Use update_all to update multiple objects with multiple values

580 Views Asked by At

I have to update multiple objects with multiple values like this:

project.update(user_attributes: task_ids.collect { |id| { 'task_id': id } })

But the above code will result in n + 1. Any ideas in order to avoid n + 1 here?

0

There are 0 best solutions below