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

Add assertion error for incorrect relationship type #377

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ckung
Copy link
Collaborator

@ckung ckung commented Jun 8, 2014

Throw an assertion error if the user is creating records via store, but does not define their relationships in such a way that will continue using the store. Relationships must be defined as a string, post and not App.Post if the record has a container. This is to ensure the application is creating records with a container - all or nothing.

@@ -2,7 +2,11 @@ Ember.Model.Store = Ember.Object.extend({
container: null,

modelFor: function(type) {
return this.container.lookupFactory('model:'+type);
if (typeof type === 'string') {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sanity check

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

Successfully merging this pull request may close these issues.

2 participants