Skip to content

Instantly share code, notes, and snippets.

@CodeOfficer
Created February 11, 2014 16:58
Show Gist options
  • Save CodeOfficer/2818c6e8de7f396c886e to your computer and use it in GitHub Desktop.
Save CodeOfficer/2818c6e8de7f396c886e to your computer and use it in GitHub Desktop.
// A fix for the ember chrome extension so that we can peek into the data store
// see https://github.com/stefanpenner/ember-app-kit/issues/263#issuecomment-28482992
/* global require */
export default DS.DebugAdapter.reopen({
getModelTypes: function() {
var self = this;
return Ember.keys(requirejs._eak_seen).filter(function(key) {
return !!key.match(/^appkit\/models\//) && self.detect(require(key)['default']);
}).map(function(key){
var type = require(key)['default'];
var typeKey = key.match(/^appkit\/models\/(.*)/)[1];
type.toString = function() { return typeKey; };
return type;
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment