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

Primary key property not validated in .create() #1868

Closed
2 tasks
hacksparrow opened this issue Sep 21, 2020 · 3 comments
Closed
2 tasks

Primary key property not validated in .create() #1868

hacksparrow opened this issue Sep 21, 2020 · 3 comments

Comments

@hacksparrow
Copy link
Contributor

The current implementation of .isValid() does not detect missing primary key property in .create().

    const User = ds.createModel('User', {
      id: {type: 'string', id: true},
      email: {type: 'string'}
    });

    // Does not throw
    it('should throw if id is not specified', async () => {
      await User.create({name: 'Carro'}).should.be.rejected();
    });

Acceptance criteria

  • Attempting to create a model without a primary key should throw an error
  • Add test(s)
@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 25, 2020
@hacksparrow hacksparrow removed the stale label Dec 30, 2020
@stale
Copy link

stale bot commented Jul 14, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 14, 2021
@stale
Copy link

stale bot commented Jul 28, 2021

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant