Skip to content

Instantly share code, notes, and snippets.

@rondale-sc
Created March 21, 2016 19:12
Show Gist options
  • Select an option

  • Save rondale-sc/aff704263de5a9e622d2 to your computer and use it in GitHub Desktop.

Select an option

Save rondale-sc/aff704263de5a9e622d2 to your computer and use it in GitHub Desktop.
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