Created
November 3, 2016 15:23
-
-
Save simme/549949eaa0601f63d2d741fe99fe46e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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 | |
} | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`; | |
}) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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