Skip to content

Instantly share code, notes, and snippets.

@biscuitvile
Created July 17, 2015 22:08
Show Gist options
  • Save biscuitvile/352305495a727f5462d7 to your computer and use it in GitHub Desktop.
Save biscuitvile/352305495a727f5462d7 to your computer and use it in GitHub Desktop.
import DS from "ember-data";
import Ember from "ember";
import ENV from "frontent/config/environment";
function formatAttributeName(attr) {
if (ENV['ember-cli-mirage'].enabled) {
return Ember.String.camelize(attr);
} else {
return Ember.String.decamelize(attr);
}
}
export default DS.JSONAPISerializer.extend({
keyForAttribute: function(attr) {
return formatAttributeName(attr);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment