Created
November 26, 2017 02:17
-
-
Save denzo/966600cc8fb927e0f89f2eebe06e2def to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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