Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapter lookup #57

Closed
dbollinger opened this issue Mar 18, 2015 · 3 comments
Closed

Adapter lookup #57

dbollinger opened this issue Mar 18, 2015 · 3 comments

Comments

@dbollinger
Copy link

I believe the parameter passed into adapterFor here should be relationship.type rather than typeKey:

relationshipToResourceUri: function (relationship, value){
        if (!value)
          return value;

        var store = relationship.type.store,
            typeKey = relationship.type.typeKey;

        return store.adapterFor(typeKey).buildURL(typeKey, get(value, 'id'));
      },

ember-data looks for type.typeKey in the adapterFor function:

  /**
    Returns the adapter for a given type.

    @method adapterFor
    @private
    @param {subclass of DS.Model} type
    @return DS.Adapter
  */
  adapterFor: function(type) {
    var container = this.container, adapter;

    if (container) {
      adapter = container.lookup('adapter:' + type.typeKey) || container.lookup('adapter:application');
    }

    return adapter || get(this, 'defaultAdapter');
  },
@pedrokiefer
Copy link
Collaborator

The adapter is currently somewhat broken with ember-data beta.15 and beta.16, I'll try to fix it.

@dbollinger
Copy link
Author

Looks like your latest updates for beta.17 compatibility have taken care of this issue. Everything seems to be working very nicely- nice work on the ember-cli support.

@pedrokiefer
Copy link
Collaborator

Great, I still need to update the docs, but things should be working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants