Skip to content

Commit

Permalink
Release 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
emuvente committed Feb 1, 2016
1 parent 82f510d commit 5f6949f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backbone.siren",
"version": "0.4.0",
"version": "0.4.1",
"dependencies": {
"backbone": "~1.1.0",
"jquery": "~2.0.0",
Expand Down
9 changes: 6 additions & 3 deletions dist/amd/backbone.siren.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Backbone.Siren v0.4.0
* Backbone.Siren v0.4.1
*
* Copyright (c) 2015 Kiva Microfunds
* Copyright (c) 2016 Kiva Microfunds
* Licensed under the MIT license.
* https://github.com/kiva/backbone.siren/blob/master/license.txt
*/
Expand Down Expand Up @@ -654,6 +654,7 @@ define(['jquery', 'underscore', 'backbone'], function ($, _, Backbone) {

/**
* Given a url string, splits it and returns an array.
* @todo - Siren does not, yet, have a standard notation for referencing sub-entities / properties
*
* @param {String} str
* @returns {Array}
Expand Down Expand Up @@ -1231,7 +1232,9 @@ define(['jquery', 'underscore', 'backbone'], function ($, _, Backbone) {
, getRootForPath: function (path) {
// remove parameters an anchor tags from path
var strippedPath = path.split(/[\?#]/)[0];
return this.alternateRoots[strippedPath] ? this.alternateRoots[strippedPath] : this.apiRoot;
// grab the parent path (0 is "", 1 is parent)
var strippedPathParent = '/' + strippedPath.split('/')[1];
return this.alternateRoots[strippedPath] ? this.alternateRoots[strippedPath] : this.alternateRoots[strippedPathParent] ? this.alternateRoots[strippedPathParent] : this.apiRoot;
}


Expand Down
6 changes: 3 additions & 3 deletions dist/amd/backbone.siren.min.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions dist/iife/backbone.siren.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Backbone.Siren v0.4.0
* Backbone.Siren v0.4.1
*
* Copyright (c) 2015 Kiva Microfunds
* Copyright (c) 2016 Kiva Microfunds
* Licensed under the MIT license.
* https://github.com/kiva/backbone.siren/blob/master/license.txt
*/
Expand Down Expand Up @@ -654,6 +654,7 @@

/**
* Given a url string, splits it and returns an array.
* @todo - Siren does not, yet, have a standard notation for referencing sub-entities / properties
*
* @param {String} str
* @returns {Array}
Expand Down Expand Up @@ -1231,7 +1232,9 @@
, getRootForPath: function (path) {
// remove parameters an anchor tags from path
var strippedPath = path.split(/[\?#]/)[0];
return this.alternateRoots[strippedPath] ? this.alternateRoots[strippedPath] : this.apiRoot;
// grab the parent path (0 is "", 1 is parent)
var strippedPathParent = '/' + strippedPath.split('/')[1];
return this.alternateRoots[strippedPath] ? this.alternateRoots[strippedPath] : this.alternateRoots[strippedPathParent] ? this.alternateRoots[strippedPathParent] : this.apiRoot;
}


Expand Down
6 changes: 3 additions & 3 deletions dist/iife/backbone.siren.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backbone.siren",
"version": "0.4.0",
"version": "0.4.1",
"description": "Converts Siren JSON representations into Backbone Models and Collections",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 5f6949f

Please sign in to comment.