So you added a new callback to your model that (e.g.) caches some data when it is saved. Now you need to run that callback for the 10000 existing records in the production database. You have two options here:
If you choose to re-save every record, try not to simply use save!
because it also re-runs every single validation and other callback in the model. Although this should be save 99% of the time, it's also slow and tempting fate. Use this code instead to only run the new callback method and skip validations and other callbacks:
Model.all.each do |m|
m.send(:new_callback_method)
m.send(:update_without_callbacks)
end
'Done'