getoutreach / epf

A framework for keeping your Ember.js apps in sync.
http://epf.io
MIT License
369 stars 33 forks source link

typeKey seems incompatible with non-global Ember #125

Closed machty closed 10 years ago

machty commented 10 years ago

https://github.com/getoutreach/epf/blob/master/lib/model/model.js#L184

This line of code seems hardwired to expect something like App.ModelName, whereas EAK and ember-cli use the ember-resolver that produces something looking like

"retailer-admin@model:inbox-item:"

see here: https://github.com/stefanpenner/ember-jj-abrams-resolver/blob/master/packages/ember-resolver/lib/core.js#L220

Not sure the right way to go here; Ember Data seems hardwired to do typeKey = normalizedKey.split(':', 2)[1];, so not sure how that works with global Ember apps.

ghempton commented 10 years ago

I think we should just keep these types of conventions in line with Ember Data (which this original code was actually taken from as well).

In the mean time, this can easily be resolved in any app by explicitly defining typeKey:

var Post = Ep.Model.extend({
  typeKey: 'post'
});