Skip to content

Commit

Permalink
Merge pull request #3571 from HeroicEric/update-readme-examples
Browse files Browse the repository at this point in the history
[DOC release] Update README examples
  • Loading branch information
bmac committed Jul 22, 2015
2 parents 3930e45 + df05038 commit e7ae436
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Expand Up @@ -61,7 +61,7 @@ ES6 modules (via ember-cli):
import DS from 'ember-data';

export default DS.Model.extend({
title: DS.attr(),
title: DS.attr('string'),
createdAt: DS.attr('date'),

comments: DS.hasMany('comment')
Expand All @@ -71,10 +71,10 @@ export default DS.Model.extend({
import DS from 'ember-data';

export default DS.Model.extend({
body: DS.attr(),
username: DS.attr(),
body: DS.attr('string'),
username: DS.attr('string'),

post: DS.belongsTo('blogPost')
post: DS.belongsTo('blog-post')
});
```

Expand All @@ -87,17 +87,17 @@ var hasMany = DS.hasMany;
var belongsTo = DS.belongsTo;

App.BlogPost = DS.Model.extend({
title: attr(),
title: attr('string'),
createdAt: attr('date'),

comments: hasMany('comment')
});

App.Comment = DS.Model.extend({
body: attr(),
username: attr(),
body: attr('string'),
username: attr('string'),

post: belongsTo('blogPost')
post: belongsTo('blog-post')
});
```

Expand Down Expand Up @@ -126,15 +126,15 @@ Server](http://emberjs.com/guides/models/connecting-to-an-http-server/).
From your route or controller:

```js
this.store.findAll('blogPost');
this.store.findAll('blog-post');
```

This returns a promise that resolves to the collection of records.

### Fetching a Single Model

```js
this.store.find('blogPost', 123);
this.store.findRecord('blog-post', 123);
```

This returns a promise that resolves to the requested record. If the
Expand Down

0 comments on commit e7ae436

Please sign in to comment.