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?
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?