ah, so this is tech debt we need to pay off soon :(

`reopenClass` is important for inheritance, so that's preferable to just
setting `adapter`.


On Thu, Mar 20, 2014 at 9:27 AM, Christina <notifications@github.com> wrote:

> In packages/ember-model/lib/belongs_to.js:
>
> > @@ -2,9 +2,18 @@ var get = Ember.get,
> >      set = Ember.set;
> >
> >  function getType(record) {
> > -  if (typeof this.type === "string") {
> > -    this.type =  Ember.get(Ember.lookup, this.type) || record.container.lookupFactory('model:' + this.type);
> > +  var type = this.type;
> > +
> > +  if (typeof this.type === "string" && this.type) {
> > +    this.type = Ember.get(Ember.lookup, this.type);
> > +
> > +    if (!this.type) {
> > +      var store = Ember.Model.Store.create({ container: record.container });
> > +      this.type = store.modelFor(type);
> > +      this.type.reopenClass({ adapter: store.adapterFor(type) });
>
> thats how i wrote it in the store. @josbeir <https://github.com/josbeir>you can just write this.type.adapter
> = store.adapterFor(type)
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/ebryn/ember-model/pull/334/files#r10802842>
> .
>