Ruby on Rails Sunday, December 24, 2017

On 23 December 2017 at 14:02, Robert Phillips
<robert.phillips37@gmail.com> wrote:
> I've got the program in chapter 2.
>
> is there anything i can type in the console to reset the id? I can do e.g.
> User.delete_all and delete all users, but if a new user is then created it
> doesn't have an id of 1 'cos the id doesn't reset.

To add to what others have said, if you want an id you can reference
that you have full control over then add another field for that, the
standard id field is not even guaranteed to start at 1 and increment
uniformly, different databases may generate ids in different ways.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsPyKs1H1LzaD0Vju%3DdJfivEKfkTOkviwLSOBnJCAPgHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment