If you want a "counter-type" id , you can always do what fixture_adapter does, which should have a variable called counter , and increment it every time (see here ).
But then, what happens if the record is deleted? Do you want to have another new record with the id of the old deleted record? And if instead you have some kind of global counter that ALWAYS increments by 1, which will take into account the problem that I mention, then in any case you just assign quite a few random identifiers, so why not go with the generating approach random identifiers, where did you start? :)
source share