On 26 December 2015 at 15:52, 'krfg' via Ruby on Rails: Talk
<rubyonrails-talk@googlegroups.com> wrote:
> Have any of you any idea why at Heroku the first user created would get id 2
> instead of 1, and ActiveRecord cannot find user with id 1?
>
> After deploying my application I created a new user and noticed that the
> address bar was reporting number 2 at the end of the url:
> http://...herokuapp.com/users/2.
Did you create a user and then delete it again? If so then that would
explain it. id numbers are not reused. Whatever the reason do not
worry about it, you should never assume anything about the actual
value of an id, just consider it to be a random value.
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%3D0gLtraEuWocgB9p4iTEWtPPnP9JRkVU-n_O2ontuaU%2BE23w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment