Skip to content

Instantly share code, notes, and snippets.

@danmcclain
Created August 3, 2015 18:23
Show Gist options
  • Select an option

  • Save danmcclain/e393c13e4e84249bcd1a to your computer and use it in GitHub Desktop.

Select an option

Save danmcclain/e393c13e4e84249bcd1a to your computer and use it in GitHub Desktop.
import Resolver from 'ember/resolver';
export default Resolver.extend({
moduleNameLookupPatterns: Ember.computed(function(){
var superValue = this._super.apply(this, arguments);
superValue.unshiftObject(this.somethingThatIsAwesome);
return superValue;
}),
somethingThatIsAwesome: function(parsedName) {
var podPrefix = this.namespace.podModulePrefix || this.namespace.modulePrefix;
var fullNameWithoutType = parsedName.fullNameWithoutType;
if (parsedName.type === 'model' ||
parsedName.type === 'adapter' ||
parsedName.type === 'store' ||
parsedName.type === 'serializer') {
return podPrefix + '/data/' + fullNameWithoutType + '/' + parsedName.type;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment