Created
March 21, 2016 19:12
-
-
Save rondale-sc/aff704263de5a9e622d2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import Ember from 'ember'; | |
| import ActiveModelSerializer from 'ember-cli-mirage/serializers/active-model-serializer' | |
| import { pluralize } from 'ember-inflector'; | |
| const { camelize, dasherize } = Ember.String; | |
| export default ActiveModelSerializer.extend({ | |
| keyForModel(type) { | |
| return camelize(type); | |
| }, | |
| keyForAttribute(attr) { | |
| return camelize(attr); | |
| }, | |
| keyForRelationship(type) { | |
| return pluralize(camelize(type)); | |
| }, | |
| keyForRelationshipIds(type) { | |
| return `${camelize(type)}_ids`; | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment