Let us have some model in Rails application, represented by set of DB records. Each of them will have an ‘id’ field. If we delete a few first records, the Model.first method will return Model with id > 0.
So, the question is: how to update all the records in DB (in ‘Rails style’) to have records with the id field, starting from zero?
Id field should not carry an information value. If you want the records to have numbers starting from 0, just add ‘number’ field and a unique index on that field.
Edit: This is the “Rails way” how to do it.