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

Update references to find methods #12638

Merged
merged 1 commit into from
Nov 27, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/ember-routing/lib/system/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ var Route = EmberObject.extend(ActionHandler, Evented, {
});
```

The model for the `post` route is `store.find('post', params.post_id)`.
The model for the `post` route is `store.findRecord('post', params.post_id)`.

By default, if your route has a dynamic segment ending in `_id`:

Expand All @@ -1423,15 +1423,15 @@ var Route = EmberObject.extend(ActionHandler, Evented, {
this.transitionTo('posts');

// model passed in, so model hook not called
thePost = store.find('post', 1);
thePost = store.findRecord('post', 1);
this.transitionTo('post', thePost);

// integer passed in, model hook is called
this.transitionTo('post', 1);

// model id passed in, model hook is called
// useful for forcing the hook to execute
thePost = store.find('post', 1);
thePost = store.findRecord('post', 1);
this.transitionTo('post', thePost.id);
```

Expand All @@ -1446,7 +1446,7 @@ var Route = EmberObject.extend(ActionHandler, Evented, {
```javascript
App.PostRoute = Ember.Route.extend({
model: function(params) {
return this.store.find('post', params.post_id);
return this.store.findRecord('post', params.post_id);
}
});
```
Expand Down Expand Up @@ -1623,7 +1623,7 @@ var Route = EmberObject.extend(ActionHandler, Evented, {
```javascript
App.PhotosRoute = Ember.Route.extend({
model: function() {
return this.store.find('photo');
return this.store.findAll('photo');
},

setupController: function (controller, model) {
Expand Down