Lets say I have some Users and I want to update their ages because I put them in wrong at first. I could do them one at a time as:
User.find(20).update(age: 25)
But can I pull the users with an array, and then update each individual with the corresponding place in another array? I'm imagining something like:
User.find([20,46,78]).update_all(age: [25, 50, 43])
I have a list of User ids and what their correct ages are supposed to be, so I want to change the existing ones for those users. What's the best way to do this?