Skip to content

Commit bbc8614

Browse files
committed
Prepare for next development cycle.
Moved loop in findAll to avoid a possible null pointer exception.
1 parent 87b167a commit bbc8614

File tree

7 files changed

+25
-16
lines changed

7 files changed

+25
-16
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
##### 0.10.2 - xx July 2014 (pending)
2+
3+
###### Backwards compatible bug fixes
4+
- #100 - DS.findAll wasn't added to completedQueries
5+
16
##### 0.10.2 - 21 July 2014
27

38
###### Backwards compatible bug fixes

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
__Data store for Angular.js.__
44

55
__Latest Release:__ [0.10.2](http://angular-data.pseudobry.com/)
6-
__master:__ [0.10.2](http://angular-data-next.pseudobry.com/)
6+
__master:__ [0.10.3](http://angular-data-next.pseudobry.com/)
77

88
Angular-data is approaching 1.0.0 Beta. The API is stabilizing and angular-data is well tested.
99

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "Jason Dobry",
33
"name": "angular-data",
44
"description": "Data store for Angular.js.",
5-
"version": "0.10.2",
5+
"version": "0.10.3",
66
"homepage": "http://angular-data.pseudobry.com/",
77
"repository": {
88
"type": "git",

dist/angular-data.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -2338,16 +2338,18 @@ function processResults(utils, data, resourceName, queryHash) {
23382338
delete resource.pendingQueries[queryHash];
23392339
resource.completedQueries[queryHash] = date;
23402340

2341-
// Make sure each object is added to completedQueries
2342-
angular.forEach(data, function (obj, idx) {
2343-
resource.completedQueries[obj[idAttribute]] = date;
2344-
});
2345-
23462341
// Update modified timestamp of collection
23472342
resource.collectionModified = utils.updateTimestamp(resource.collectionModified);
23482343

23492344
// Merge the new values into the cache
2350-
return this.inject(resourceName, data);
2345+
var injected = this.inject(resourceName, data);
2346+
2347+
// Make sure each object is added to completedQueries
2348+
angular.forEach(injected, function (item) {
2349+
resource.completedQueries[item[idAttribute]] = date;
2350+
});
2351+
2352+
return injected;
23512353
}
23522354

23532355
function _findAll(utils, resourceName, params, options) {

dist/angular-data.min.js

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

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-data",
33
"description": "Data store for Angular.js.",
4-
"version": "0.10.2",
4+
"version": "0.10.3",
55
"homepage": "http://angular-data.pseudobry.com",
66
"repository": {
77
"type": "git",

src/datastore/async_methods/findAll.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ function processResults(utils, data, resourceName, queryHash) {
1111
delete resource.pendingQueries[queryHash];
1212
resource.completedQueries[queryHash] = date;
1313

14-
// Make sure each object is added to completedQueries
15-
angular.forEach(data, function (obj, idx) {
16-
resource.completedQueries[obj[idAttribute]] = date;
17-
});
18-
1914
// Update modified timestamp of collection
2015
resource.collectionModified = utils.updateTimestamp(resource.collectionModified);
2116

2217
// Merge the new values into the cache
23-
return this.inject(resourceName, data);
18+
var injected = this.inject(resourceName, data);
19+
20+
// Make sure each object is added to completedQueries
21+
angular.forEach(injected, function (item) {
22+
resource.completedQueries[item[idAttribute]] = date;
23+
});
24+
25+
return injected;
2426
}
2527

2628
function _findAll(utils, resourceName, params, options) {

0 commit comments

Comments
 (0)