Skip to content

Commit

Permalink
Merge pull request #12638 from StevenNunez/patch-1
Browse files Browse the repository at this point in the history
Update references to find methods
  • Loading branch information
stefanpenner committed Nov 27, 2015
2 parents e931fd7 + 7db3a0d commit 4638cbc
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit 4638cbc

Please sign in to comment.