From 908ddc268123122ad2864462c9c1a14479400a98 Mon Sep 17 00:00:00 2001 From: Jason Williams Date: Fri, 5 Dec 2014 22:20:10 +0000 Subject: [PATCH] Update Ember-Data. No Issue - ember-data@beta.12 - ember-data now warns if a payload contains properties that do not exist in the model. Because of this all missing model attributes have been added (without their relationship defined) because they're currently unused and we don't need to generate additional API requests to resolve the async relationships. --- bower.json | 2 +- core/client/models/post.js | 3 +++ core/client/models/role.js | 2 ++ core/client/models/tag.js | 9 +++++++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index 6ce2607901..2b269f75d3 100644 --- a/bower.json +++ b/bower.json @@ -5,7 +5,7 @@ "Countable": "2.0.2", "device": "git://github.com/matthewhudson/device.js#5347a275b66020a0d4dfe9aad81a488f8cce448d", "ember": "1.9.0", - "ember-data": "1.0.0-beta.11", + "ember-data": "1.0.0-beta.12", "ember-load-initializers": "git://github.com/stefanpenner/ember-load-initializers.git#0.0.1", "ember-resolver": "git://github.com/stefanpenner/ember-jj-abrams-resolver.git#181251821cf513bb58d3e192faa13245a816f75e", "ember-simple-auth": "0.7.2", diff --git a/core/client/models/post.js b/core/client/models/post.js index e5c0bebea6..88fc7721ca 100644 --- a/core/client/models/post.js +++ b/core/client/models/post.js @@ -19,8 +19,11 @@ var Post = DS.Model.extend(NProgressSaveMixin, ValidationEngine, { author: DS.belongsTo('user', {async: true}), author_id: DS.attr('number'), updated_at: DS.attr('moment-date'), + updated_by: DS.attr(), published_at: DS.attr('moment-date'), published_by: DS.belongsTo('user', {async: true}), + created_at: DS.attr('moment-date'), + created_by: DS.attr(), tags: DS.hasMany('tag', {embedded: 'always'}), url: DS.attr('string'), diff --git a/core/client/models/role.js b/core/client/models/role.js index dca5c1bca7..3676e38fc3 100644 --- a/core/client/models/role.js +++ b/core/client/models/role.js @@ -4,6 +4,8 @@ var Role = DS.Model.extend({ description: DS.attr('string'), created_at: DS.attr('moment-date'), updated_at: DS.attr('moment-date'), + created_by: DS.attr(), + updated_by: DS.attr(), lowerCaseName: Ember.computed('name', function () { return this.get('name').toLocaleLowerCase(); diff --git a/core/client/models/tag.js b/core/client/models/tag.js index a8053bbbd2..1163e8c9e0 100644 --- a/core/client/models/tag.js +++ b/core/client/models/tag.js @@ -8,10 +8,15 @@ var Tag = DS.Model.extend(NProgressSaveMixin, ValidationEngine, { name: DS.attr('string'), slug: DS.attr('string'), description: DS.attr('string'), - parent_id: DS.attr('number'), + parent: DS.attr(), meta_title: DS.attr('string'), meta_description: DS.attr('string'), - image: DS.attr('string') + image: DS.attr('string'), + hidden: DS.attr('boolean'), + created_at: DS.attr('moment-date'), + updated_at: DS.attr('moment-date'), + created_by: DS.attr(), + updated_by: DS.attr() }); export default Tag;