Skip to content

Commit 08d5f6c

Browse files
committed
Stable Version 1.1.1.
Fixes #9
1 parent 96c79aa commit 08d5f6c

6 files changed

+28
-8
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
##### 1.1.1 - 27 March 2015
2+
3+
###### Backwards compatible bug fixes
4+
- #9 - Race condition with missing IDs
5+
16
##### 1.1.0 - 26 March 2015
27

38
###### Backwards compatible bug fixes

dist/js-data-firebase.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* js-data-firebase
3-
* @version 1.1.0 - Homepage <http://www.js-data.io/docs/dsfirebaseadapter>
3+
* @version 1.1.1 - Homepage <http://www.js-data.io/docs/dsfirebaseadapter>
44
* @author Jason Dobry <[email protected]>
55
* @copyright (c) 2014-2015 Jason Dobry
66
* @license MIT <https://github.com/js-data/js-data-firebase/blob/master/LICENSE>
@@ -82,6 +82,7 @@ return /******/ (function(modules) { // webpackBootstrap
8282
var deepMixIn = DSUtils.deepMixIn;
8383
var removeCircular = DSUtils.removeCircular;
8484
var P = DSUtils.Promise;
85+
var forOwn = DSUtils.forOwn;
8586

8687
var filter = emptyStore.defaults.defaultFilter;
8788

@@ -118,6 +119,7 @@ return /******/ (function(modules) { // webpackBootstrap
118119
if (!item) {
119120
reject(new Error("Not Found!"));
120121
} else {
122+
item[resourceConfig.idAttribute] = item[resourceConfig.idAttribute] || id;
121123
resolve(item);
122124
}
123125
}, reject, _this);
@@ -130,7 +132,13 @@ return /******/ (function(modules) { // webpackBootstrap
130132

131133
return new P(function (resolve, reject) {
132134
return _this.getRef(resourceConfig, options).once("value", function (dataSnapshot) {
133-
resolve(filter.call(emptyStore, values(dataSnapshot.val()), resourceConfig.name, params, options));
135+
var data = dataSnapshot.val();
136+
forOwn(data, function (value, key) {
137+
if (!value[resourceConfig.idAttribute]) {
138+
value[resourceConfig.idAttribute] = "/" + key;
139+
}
140+
});
141+
resolve(filter.call(emptyStore, values(data), resourceConfig.name, params, options));
134142
}, reject, _this);
135143
});
136144
}

dist/js-data-firebase.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)