Skip to content

Commit

Permalink
Merge pull request TryGhost#4855 from jaswilli/serializer-cleanup
Browse files Browse the repository at this point in the history
Update Ember-Data, remove unneeded code
  • Loading branch information
novaugust committed Jan 26, 2015
2 parents cea358b + f794490 commit 8693e1d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 31 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.12",
"ember-data": "1.0.0-beta.14.1",
"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",
Expand Down
15 changes: 0 additions & 15 deletions core/client/serializers/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,6 @@ var PostSerializer = ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, {
return this._super.apply(this, arguments);
},

keyForAttribute: function (attr) {
return attr;
},

keyForRelationship: function (relationshipName) {
// this is a hack to prevent Ember-Data from deleting our `tags` reference.
// ref: https://github.com/emberjs/data/issues/2051
// @TODO: remove this once the situation becomes clearer what to do.
if (relationshipName === 'tags') {
return 'tag';
}

return relationshipName;
},

serializeIntoHash: function (hash, type, record, options) {
options = options || {};
options.includeId = true;
Expand Down
15 changes: 0 additions & 15 deletions core/client/serializers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,6 @@ var UserSerializer = ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, {
delete payload[pluralizedRoot];

return this._super.apply(this, arguments);
},

keyForAttribute: function (attr) {
return attr;
},

keyForRelationship: function (relationshipName) {
// this is a hack to prevent Ember-Data from deleting our `tags` reference.
// ref: https://github.com/emberjs/data/issues/2051
// @TODO: remove this once the situation becomes clearer what to do.
if (relationshipName === 'roles') {
return 'role';
}

return relationshipName;
}
});

Expand Down

0 comments on commit 8693e1d

Please sign in to comment.