ember-fryctoria
ember-fryctoria copied to clipboard
Ember Data transform is not not supported.
Temporary work around:
Say you have a transform file like this: app/transforms/moment.js
/* global moment */
import Ember from 'ember';
import DS from 'ember-data';
import ENV from 'beauty-now-pro-ember/config/environment';
var format = ENV.APP.ISO_DATE_TIME_FORMAT;
export default DS.Transform.extend({
deserialize: function(string) {
var momentized = moment(string, format);
return momentized;
},
serialize: function(momentized) {
momentized.format(format);
}
});
Since the record saved in jobs queue is a serialized json, you should replace serialize function with the following:
serialize: function(momentized) {
if(momentized && momentized.format) {
return momentized.format(format);
} else {
return momentized;
}
}