Skip to content

Commit

Permalink
Stable Version 2.6.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry committed Oct 12, 2015
1 parent 30eb8a1 commit fc4870f
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 21 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
##### 2.6.1 - 12 October 2015

###### Bug fixes
- #223 - Zero value Id in relations fixed in #237 by @Pencroff

##### 2.6.0 - 08 October 2015

###### Backwards compatible API changes
Expand Down
20 changes: 12 additions & 8 deletions dist/js-data-debug.js
@@ -1,6 +1,6 @@
/*!
* js-data
* @version 2.6.0 - Homepage <http://www.js-data.io/>
* @version 2.6.1 - Homepage <http://www.js-data.io/>
* @author Jason Dobry <jason.dobry@gmail.com>
* @copyright (c) 2014-2015 Jason Dobry
* @license MIT <https://github.com/js-data/js-data/blob/master/LICENSE>
Expand Down Expand Up @@ -84,10 +84,10 @@ return /******/ (function(modules) { // webpackBootstrap
return new _datastoreIndex['default'](options);
},
version: {
full: '2.6.0',
full: '2.6.1',
major: parseInt('2', 10),
minor: parseInt('6', 10),
patch: parseInt('0', 10),
patch: parseInt('1', 10),
alpha: true ? 'false' : false,
beta: true ? 'false' : false
}
Expand Down Expand Up @@ -1313,7 +1313,9 @@ return /******/ (function(modules) { // webpackBootstrap
} else if (def.type === 'hasOne') {
if (localKey) {
prop.get = function () {
return get(this, localKey) ? definition.getResource(relationName).get(get(this, localKey)) : undefined;
var key = get(this, localKey);
var hasKey = !!(key || key === 0);
return hasKey ? definition.getResource(relationName).get(key) : undefined;
};
prop.set = function (sibling) {
if (sibling) {
Expand Down Expand Up @@ -4937,6 +4939,8 @@ return /******/ (function(modules) { // webpackBootstrap
}

var orig = __options.orig();
var defKey = def.localKey ? DSUtils.get(instance, def.localKey) : null;
var hasDefKey = !!(defKey || defKey === 0);

if (typeof def.load === 'function') {
task = def.load(definition, def, instance, orig);
Expand All @@ -4958,15 +4962,15 @@ return /******/ (function(modules) { // webpackBootstrap
}
task = relationDef.findAll(params, orig);
} else if (def.type === 'hasOne') {
if (def.localKey && DSUtils.get(instance, def.localKey)) {
task = relationDef.find(DSUtils.get(instance, def.localKey), orig);
if (def.localKey && hasDefKey) {
task = relationDef.find(defKey, orig);
} else if (def.foreignKey) {
task = relationDef.findAll(params, orig).then(function (hasOnes) {
return hasOnes.length ? hasOnes[0] : null;
});
}
} else if (DSUtils.get(instance, def.localKey)) {
task = relationDef.find(DSUtils.get(instance, def.localKey), orig);
} else if (hasDefKey) {
task = relationDef.find(defKey, orig);
}
}

Expand Down
20 changes: 12 additions & 8 deletions dist/js-data.js
@@ -1,6 +1,6 @@
/*!
* js-data
* @version 2.6.0 - Homepage <http://www.js-data.io/>
* @version 2.6.1 - Homepage <http://www.js-data.io/>
* @author Jason Dobry <jason.dobry@gmail.com>
* @copyright (c) 2014-2015 Jason Dobry
* @license MIT <https://github.com/js-data/js-data/blob/master/LICENSE>
Expand Down Expand Up @@ -84,10 +84,10 @@ return /******/ (function(modules) { // webpackBootstrap
return new _datastoreIndex['default'](options);
},
version: {
full: '2.6.0',
full: '2.6.1',
major: parseInt('2', 10),
minor: parseInt('6', 10),
patch: parseInt('0', 10),
patch: parseInt('1', 10),
alpha: true ? 'false' : false,
beta: true ? 'false' : false
}
Expand Down Expand Up @@ -1308,7 +1308,9 @@ return /******/ (function(modules) { // webpackBootstrap
} else if (def.type === 'hasOne') {
if (localKey) {
prop.get = function () {
return get(this, localKey) ? definition.getResource(relationName).get(get(this, localKey)) : undefined;
var key = get(this, localKey);
var hasKey = !!(key || key === 0);
return hasKey ? definition.getResource(relationName).get(key) : undefined;
};
prop.set = function (sibling) {
if (sibling) {
Expand Down Expand Up @@ -4913,6 +4915,8 @@ return /******/ (function(modules) { // webpackBootstrap
}

var orig = __options.orig();
var defKey = def.localKey ? DSUtils.get(instance, def.localKey) : null;
var hasDefKey = !!(defKey || defKey === 0);

if (typeof def.load === 'function') {
task = def.load(definition, def, instance, orig);
Expand All @@ -4934,15 +4938,15 @@ return /******/ (function(modules) { // webpackBootstrap
}
task = relationDef.findAll(params, orig);
} else if (def.type === 'hasOne') {
if (def.localKey && DSUtils.get(instance, def.localKey)) {
task = relationDef.find(DSUtils.get(instance, def.localKey), orig);
if (def.localKey && hasDefKey) {
task = relationDef.find(defKey, orig);
} else if (def.foreignKey) {
task = relationDef.findAll(params, orig).then(function (hasOnes) {
return hasOnes.length ? hasOnes[0] : null;
});
}
} else if (DSUtils.get(instance, def.localKey)) {
task = relationDef.find(DSUtils.get(instance, def.localKey), orig);
} else if (hasDefKey) {
task = relationDef.find(defKey, orig);
}
}

Expand Down
6 changes: 3 additions & 3 deletions dist/js-data.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js-data.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "js-data",
"description": "Robust, framework-agnostic in-memory data store.",
"version": "2.6.0",
"version": "2.6.1",
"homepage": "http://www.js-data.io",
"repository": {
"type": "git",
Expand Down

0 comments on commit fc4870f

Please sign in to comment.