Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@simme
Created November 3, 2016 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simme/549949eaa0601f63d2d741fe99fe46e5 to your computer and use it in GitHub Desktop.
Save simme/549949eaa0601f63d2d741fe99fe46e5 to your computer and use it in GitHub Desktop.
"data": [
{
"id": 1,
"type": "ingredient",
"attributes": {
"name": {
"en": "Cilantro",
"sv": "Koriander"
},
"createdAt": "2016-10-31T14:48:49.000Z",
"updatedAt": "2016-10-31T14:48:49.000Z",
"translations": [
"en",
"sv"
],
"isFullyLocalized": true
}
},
{
"id": 2,
"type": "ingredient",
"attributes": {
"name": {
"en": "Coriander",
"sv": "Koriander"
},
"createdAt": "2016-10-31T14:50:24.000Z",
"updatedAt": "2016-10-31T14:50:24.000Z",
"translations": [
"en",
"sv"
],
"isFullyLocalized": true
}
},
{
"id": 3,
"type": "ingredient",
"attributes": {
"name": {
"en": "Coriander"
},
"createdAt": "2016-10-31T14:50:47.000Z",
"updatedAt": "2016-10-31T14:50:47.000Z",
"translations": [
"en",
"sv"
],
"isFullyLocalized": false
}
},
{
"id": 4,
"type": "ingredient",
"attributes": {
"name": {
"en": "Coriander"
},
"createdAt": "2016-10-31T14:55:59.000Z",
"updatedAt": "2016-10-31T14:55:59.000Z",
"translations": [
"en",
"sv"
],
"isFullyLocalized": false
}
},
{
"id": 5,
"type": "ingredient",
"attributes": {
"name": {
"en": "Coriander"
},
"createdAt": "2016-10-31T14:56:15.000Z",
"updatedAt": "2016-10-31T14:56:15.000Z",
"translations": [
"en",
"sv"
],
"isFullyLocalized": false
}
},
{
"id": 6,
"type": "ingredient",
"attributes": {
"name": {
"en": "Coriander",
"sv": "Koriander"
},
"createdAt": "2016-10-31T15:00:04.000Z",
"updatedAt": "2016-10-31T15:00:04.000Z",
"translations": [
"en",
"sv"
],
"isFullyLocalized": true
}
},
{
"id": 7,
"type": "ingredient",
"attributes": {
"name": {
"en": "Coriander",
"sv": "Koriander"
},
"createdAt": "2016-10-31T15:17:26.000Z",
"updatedAt": "2016-10-31T15:17:26.000Z",
"translations": [
"en",
"sv"
],
"isFullyLocalized": true
}
},
{
"id": 8,
"type": "ingredient",
"attributes": {
"name": {
"en": "Coriander",
"sv": "Koriander"
},
"createdAt": "2016-11-03T06:17:07.000Z",
"updatedAt": "2016-11-03T06:17:07.000Z",
"translations": [
"en",
"sv"
],
"isFullyLocalized": true
}
}
]
}
import DS from 'ember-data';
const { attr } = DS;
export default DS.Model.extend({
name: attr(),
translations: attr(),
isFullyLocalized: attr('boolean', { defaultValue: false }),
createdAt: attr('date'),
updatedAt: attr('date'),
englishName: Ember.computed('name', 'translations', function () {
return `${this.get('name').en}`;
})
});
export default Ember.Route.extend({
model () {
return this.get('store').findAll('ingredient');
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment