Skip to content

Commit

Permalink
Give each Model a reference to the apiRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
uglymunky committed Apr 29, 2014
1 parent 65351f7 commit 7bfe0d7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/backbone.siren.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,9 @@ function request(rel) {
return _.indexOf(link.rel, rel) > -1;
});

if (! link) {
return;
if (link) {
return BbSiren.resolveOne(link.href);
}

return BbSiren.resolveOne(link.href);
}


Expand Down Expand Up @@ -833,6 +831,10 @@ _.extend(BbSiren, {
this.siren.ajaxOptions = options.ajaxOptions;
}

if (options.apiRoot) {
this.siren.apiRoot = options.apiRoot;
}

this.parseActions();
}

Expand Down Expand Up @@ -1007,6 +1009,7 @@ BbSiren.prototype = {
, resolve: function (entityPaths, options) {
options = $.extend({}, this.options, options);
options.store = this.store;
options.apiRoot = this.apiRoot;

var self = this
, urls = [];
Expand Down

0 comments on commit 7bfe0d7

Please sign in to comment.