GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
this is more a concern than an issue.
I'm wondering what happens if the ID generated by:
var new_id = new Date().getTime();
content = content.replace(regexp, new_id);
end up being an existing record id in the DB. Wouldn't it be mistakenly erased by this new record?
That's a good question. I believe it will update the items in the existing record assuming they belong_to the same parent record. I forget if adding alpha characters into a new id will cause any problems. If not it may be worth keeping the new_ prefix that it replaces.
The ID is very large and like I said I think it has to match the same parent, so the chances of there being a conflict are very slim. Still would be nice to fix though.
prefix new record ids with new_ to ensure there's no conflict with existing records - closed by c3e667f
Excellent idea, that's nice to see Rails handling this nicely
prefix new record ids with new_ to ensure there's no conflict with ex…
…isting records - closes #21