Skip to content

Instantly share code, notes, and snippets.

@denzo
Created November 26, 2017 02:17
Show Gist options
  • Save denzo/966600cc8fb927e0f89f2eebe06e2def to your computer and use it in GitHub Desktop.
Save denzo/966600cc8fb927e0f89f2eebe06e2def to your computer and use it in GitHub Desktop.
// app/transforms/action-status.js
import Transform from 'ember-data/transform';
import { STATUSES } from '../constants/actions';
export default Transform.extend({
deserialize(serialized) {
return STATUSES.findBy('value', serialized);
},
serialize(deserialized = {}) {
return deserialized.value;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment