Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creation of duplicate model/database entities #184

Closed
dcbartlett opened this issue Feb 28, 2013 · 3 comments
Closed

Creation of duplicate model/database entities #184

dcbartlett opened this issue Feb 28, 2013 · 3 comments

Comments

@dcbartlett
Copy link
Contributor

When creating an entity for database consumption, i noticed that you can specify :id on a create call.

E.G. ( http://localhost:1337/user/create/ )
E.G. ( http://localhost:1337/user/create/1?username=someone )
E.G. ( http://localhost:1337/user/create/1?username=someone_else )

This will in fact create 3 different entries...
There needs to be an error thrown stating that id is already in use, or error stating that "update" should be used to make changes to the entity.

@mikermcneil
Copy link
Member

Good one- I think there are two problems here:

  1. this should never be allowed at the model level, since the uniqueness constraint / PK should be enforced
  2. the scaffold should give a helpful error message, as you just pointed out

@dcbartlett
Copy link
Contributor Author

On second thought, this needs to be looked at further as this was a fix in controller scaffolding, and not at the model level.

@dcbartlett dcbartlett reopened this Mar 15, 2013
@mikermcneil
Copy link
Member

Closed in favor of #121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants