Skip to content

Commit

Permalink
Fixes #225.
Browse files Browse the repository at this point in the history
Stable Version 1.0.0-alpha.4-0.
  • Loading branch information
jmdobry committed Nov 4, 2014
1 parent 37bd069 commit 4c4521a
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
##### 1.2.1 - 04 November 2014

###### Backwards compatible bug fixes
- #225 - If the server returned an empty array for a get request (valid scenario), angular-data throws an exception

##### 1.2.0 - 02 November 2014

###### Backwards compatible API changes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Unlike Backbone and Ember Models, angular-data does not require the use of gette

Supporting relations, computed properties, model lifecycle control and a slew of other features, angular-data is the tool for giving your data the respect it deserves.

__Latest Release:__ [1.2.0](https://github.com/jmdobry/angular-data/releases/tag/1.2.0)
__Latest Release:__ [1.2.1](https://github.com/jmdobry/angular-data/releases/tag/1.2.1)

Angular-data is finally 1.0.!

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Jason Dobry",
"name": "angular-data",
"description": "Data store for Angular.js.",
"version": "1.2.0",
"version": "1.2.1",
"homepage": "http://angular-data.pseudobry.com/",
"repository": {
"type": "git",
Expand Down
11 changes: 7 additions & 4 deletions dist/angular-data.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @author Jason Dobry <jason.dobry@gmail.com>
* @file angular-data.js
* @version 1.2.0 - Homepage <http://angular-data.pseudobry.com/>
* @version 1.2.1 - Homepage <http://angular-data.pseudobry.com/>
* @copyright (c) 2014 Jason Dobry <https://github.com/jmdobry/>
* @license MIT <https://github.com/jmdobry/angular-data/blob/master/LICENSE>
*
Expand Down Expand Up @@ -5124,7 +5124,7 @@ function errorPrefix(resourceName) {
*
* @param {string} resourceName The resource type, e.g. 'user', 'comment', etc.
* @param {string|number} id The primary key of the item of the changes to retrieve.
* @param {=object} options Optional configuration. Properties:
* @param {object=} options Optional configuration. Properties:
*
* - `{array=}` - `blacklist` - Array of strings or RegExp that specify fields that should be ignored when checking for changes.
*
Expand Down Expand Up @@ -6687,8 +6687,10 @@ function inject(resourceName, attrs, options) {
}

if (options.linkInverse) {
if (DS.utils.isArray(injected) && injected.length) {
DS.linkInverse(definition.name, injected[0][definition.idAttribute]);
if (DS.utils.isArray(injected)) {
if (injected.length) {
DS.linkInverse(definition.name, injected[0][definition.idAttribute]);
}
} else {
DS.linkInverse(definition.name, injected[definition.idAttribute]);
}
Expand Down Expand Up @@ -7700,6 +7702,7 @@ module.exports = ['$q', function ($q) {
var added = {};
var removed = {};
var changed = {};
blacklist = blacklist || [];

for (var prop in oldObject) {
var newValue = object[prop];
Expand Down
6 changes: 3 additions & 3 deletions dist/angular-data.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,7 +1,7 @@
{
"name": "angular-data",
"description": "Data store for Angular.js.",
"version": "1.2.0",
"version": "1.2.1",
"homepage": "http://angular-data.pseudobry.com",
"repository": {
"type": "git",
Expand Down
6 changes: 4 additions & 2 deletions src/datastore/sync_methods/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,10 @@ function inject(resourceName, attrs, options) {
}

if (options.linkInverse) {
if (DS.utils.isArray(injected) && injected.length) {
DS.linkInverse(definition.name, injected[0][definition.idAttribute]);
if (DS.utils.isArray(injected)) {
if (injected.length) {
DS.linkInverse(definition.name, injected[0][definition.idAttribute]);
}
} else {
DS.linkInverse(definition.name, injected[definition.idAttribute]);
}
Expand Down
1 change: 1 addition & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ module.exports = ['$q', function ($q) {
var added = {};
var removed = {};
var changed = {};
blacklist = blacklist || [];

for (var prop in oldObject) {
var newValue = object[prop];
Expand Down

0 comments on commit 4c4521a

Please sign in to comment.