Ruby on Rails Thursday, December 31, 2015

On Wednesday, December 30, 2015 at 10:30:40 PM UTC, James Jelinek wrote:
> Sandbox won't persist data. It'll do a transactional rollback. It never really persists data. 
>
>
As I said earlier, rolling back transactions doesn't reset sequences on Postgres ( http://www.postgresql.org/docs/current/static/functions-sequence.html). Creating a record in the sandbox would create a gap in the id sequence.

Fred

> But your quirk is interesting.  I've tried duplicating it and cannot. 
>
> Sent from my iPhone
>
> On Dec 30, 2015, at 4:26 PM, 'krfg' via Ruby on Rails: Talk <rubyonrails-talk@googlegroups.com> wrote:
>
>
>
>
> On Tuesday, December 29, 2015 at 7:31:36 PM UTC+1, tamouse wrote:
>
> >> What happened when you tried creating a new test application?
>
> >>
>
>
> The problem as you've stated it is that your first user gets id=2. The
>
> point of the test is to find the minimum set of conditions that
>
> reproduce that behaviour so you can see why it's happening...... Then prepare the app for heroku, create a new app at heroku for
>
> this test app, and run it on heroku and see what happens
>
> I just finished to create a new test app as you suggested.
> In the test app too first user created got id 2 instead of 1, and there is no user with id 1.
> I am really puzzled...
>
> I recreated the same conditions of the former application, following the same steps.
> However I did not repeated the error of duplicating the User model and of migrating the migration in any topic branch. This means that what is creating the issue is something else.
>
> I used a new, totally separated public workspace at Colud9.
>
> I tried to figure out what can causing the issue and found just 2 possible explanations:
>
> 1. I added a new user in my development environment at Cloud9 and deployed at Heroku without resetting the database at Cloud9
> 2. I added a new user at Heroku with the console in sandbox mode.
>
> Point 2 could explain what Colin Law previously suggested, that is that id numbers are not reused: is it possible that this rule is effective even when the user is created with the console in a sandbox mode?
>
>
>
>
>
>
>
> --
>
> 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/3246c189-392c-4bef-a12a-b8b51174032a%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
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/e8ad57b3-fff8-48d7-b2d2-3d10389d85ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment