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

store.find('model-type', { prop: value} ) no longer working in 0.5.4 #123

Closed
Kilowhisky opened this issue Jun 24, 2015 · 6 comments
Closed

Comments

@Kilowhisky
Copy link
Contributor

Since 0.5.4 i can no longer recover models using find or findQuery.

@Kilowhisky
Copy link
Contributor Author

I think i found the problem.

DS.hasMany('model') relationships are failing because of this line change in the last commit.

-        var foreignAdapter = type.store.adapterFor(relationModel);
+        var foreignAdapter = store.adapterFor(relationName);

The new line throws this error "No model was found for 'modelPropName'" because its attempting to pass in the relationship property name and not the model type the prop represents.

type.store.adapterFor(relationModel); does not throw any deprecations so why was it switched out?

FYI store.adapterFor(relationModel) also works without exploding.

Kilowhisky pushed a commit to Kilowhisky/ember-localstorage-adapter that referenced this issue Jul 2, 2015
@srsgores
Copy link

srsgores commented Jul 2, 2015

I may be experiencing a related bug. After upgrading to 0.5.4, I get an error when retrieving a record with store.find(modelName, id), resulting in the following error:

Error while processing route: No model was found for coApplicants

Where coApplicants is a hasMany relationship on a given model (not async)

@kurko
Copy link
Collaborator

kurko commented Jul 2, 2015

What versions of Ember Data are you using?

@srsgores
Copy link

srsgores commented Jul 2, 2015

1.18 beta

@duizendnegen
Copy link

This is affecting my solution as well - I thought it had to do with pluralization, but no

@locks
Copy link
Owner

locks commented Oct 24, 2015

#124 says it fixes this, please reopen if that's not the case.

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

5 participants