App.CM = Ember.Namespace.create({});
App.CM.ControlModule = DS.Model.extend({
name: DS.attr('string'),
locationType: DS.attr('string'),
primary: DS.attr('boolean', {
defaultValue: true
}),
published: DS.attr('boolean', {
defaultValue: false
}),
revisions: DS.hasMany('CM.revision', {
async: true
})
});
Using that namespace I have created a controlModule model. Now when I go to the store and make a call like this
this.store.find('CM:controlModule')
it seems to get confused when it tries to get the model. I tries calls the lookupFactory function with the key being ‘CM:controlModule’
this.container.lookupFactory('model:' + key)
ends up returning the whole namespace ‘model:CM’ (I can see the whole namespace being returned with all my models in it) instead of that single namespaced model.
Is there a different syntax to lookup models that are namespaced in the store?
After a bit more digging, it fails in
normalize: function(fullName) {
return this.normalizeCache[fullName] || (
this.normalizeCache[fullName] = this.normalizeFullName(fullName)
);
},
this.normalizeCache has
model:CM: "model:CM"
model:CM:*controlModule: "model:CM"
model:CM:Revision: "model:CM"
model:CM:controlModule: "model:CM"
model:model: "model:model"
model:model:CM:*controlModule: "model:mo...
which is why its returning the model:CM which is the whole namespace. Any ideas as to what I might be doing wrong?