diff --git a/app/serializers/application.js b/app/serializers/application.js index 06eaf75..771799e 100644 --- a/app/serializers/application.js +++ b/app/serializers/application.js @@ -48,6 +48,7 @@ export default DS.RESTSerializer.extend({ if (item.contextElement.attributes) { item.contextElement.attributes.forEach(function(attribute) { + // create property var property = { type: 'property', id: 'property_' + propertyIndex++, @@ -55,7 +56,6 @@ export default DS.RESTSerializer.extend({ name: attribute.name, type: attribute.type, value: attribute.value, - timestamp: attribute.metadatas[0].value }, relationships: { entity: { @@ -64,6 +64,13 @@ export default DS.RESTSerializer.extend({ } } + // find timestamp + attribute.metadatas.forEach(function(metadata) { + if (metadata.name === 'timestamp') { + property.attributes.timestamp = metadata.value; + } + }); + entity.relationships.properties.data.push({ type: 'property', id: property.id }); handleEntity(property); diff --git a/config/environment.js b/config/environment.js index cdce1b9..fb14383 100644 --- a/config/environment.js +++ b/config/environment.js @@ -42,6 +42,7 @@ module.exports = function(environment) { ENV['ember-cli-mirage'] = { enabled: true + //enabled: false } }