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

Models::areRelated should check if model has content #29

Open
DivineOmega opened this issue Sep 26, 2018 · 2 comments
Open

Models::areRelated should check if model has content #29

DivineOmega opened this issue Sep 26, 2018 · 2 comments

Comments

@DivineOmega
Copy link
Contributor

It is currently possible to use this method with newly created models that have not yet been stored in the database. This makes no sense as models that are not stored can not be related.

If a model that is not stored is passed to this method an IllegalArgumentException should be thrown.

@dextermb
Copy link
Contributor

Could loop through and check the attribute exists on each model, if false then throw the exception

@DivineOmega
Copy link
Contributor Author

DivineOmega commented Sep 26, 2018

That should work. 👍

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

No branches or pull requests

2 participants