1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/serializers/tag.js
Kevin Ansfield 91e86bde61 Update client for tag.post_count -> tag.count.posts rename
refs #6105
- adds `raw` ember-data transform to handle standard JSON `count` attribute
- update mirage factory to return correct `count.posts` format
- rename all uses of `post_count` to `count.posts`
2015-11-23 19:57:56 +00:00

19 lines
563 B
JavaScript

import Ember from 'ember';
import ApplicationSerializer from 'ghost/serializers/application';
export default ApplicationSerializer.extend({
serializeIntoHash: function (hash, type, record, options) {
options = options || {};
options.includeId = true;
var root = Ember.String.pluralize(type.modelName),
data = this.serialize(record, options);
// Properties that exist on the model but we don't want sent in the payload
delete data.uuid;
delete data.count;
hash[root] = [data];
}
});