Skip to content

Commit 078d765

Browse files
committed
Stable Version 2.1.0.
Closes #6. Closes #7.
1 parent 589e045 commit 078d765

File tree

8 files changed

+500
-235
lines changed

8 files changed

+500
-235
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
##### 2.1.0 - 10 July 2015
2+
3+
###### Backwards compatible API changes
4+
- #6 - Support loading relations in find() (better support this time)
5+
- #7 - Support loading relations in findAll() (better support this time)
6+
17
##### 2.0.0 - 02 July 2015
28

39
Stable Version 2.0.0

Gruntfile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ module.exports = function (grunt) {
4747
externals: [
4848
'mout/string/underscore',
4949
'mout/random/guid',
50+
'mout/array/map',
51+
'mout/array/unique',
5052
'js-data',
5153
'redis'
5254
],

dist/js-data-redis.js

Lines changed: 199 additions & 106 deletions
Large diffs are not rendered by default.

mocha.start.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
'use strict';
33

44
var assert = require('chai').assert;
5+
assert.equalObjects = function (a, b, m) {
6+
assert.deepEqual(JSON.parse(JSON.stringify(a)), JSON.parse(JSON.stringify(b)), m || 'Objects should be equal!');
7+
};
58
var mocha = require('mocha');
69
var sinon = require('sinon');
710
var DSRedisAdapter = require('./');
811
var JSData = require('js-data');
912
JSData.DSUtils.Promise = require('bluebird');
1013

11-
var adapter, store, DSUtils, DSErrors, User, Post, Comment;
14+
var adapter, store, DSUtils, DSErrors, Profile, User, Post, Comment;
1215

1316
var globals = module.exports = {
1417
fail: function (msg) {
@@ -56,17 +59,22 @@ beforeEach(function () {
5659
adapter = new DSRedisAdapter();
5760
DSUtils = JSData.DSUtils;
5861
DSErrors = JSData.DSErrors;
62+
globals.Profile = global.Profile = Profile = store.defineResource({
63+
name: 'profile'
64+
});
5965
globals.User = global.User = User = store.defineResource({
6066
name: 'user',
6167
relations: {
6268
hasMany: {
6369
post: {
6470
localField: 'posts',
65-
foreignKey: 'userId'
66-
},
67-
comment: {
68-
localField: 'comments',
69-
foreignKey: 'userId'
71+
foreignKey: 'post'
72+
}
73+
},
74+
hasOne: {
75+
profile: {
76+
localField: 'profile',
77+
localKey: 'profileId'
7078
}
7179
}
7280
}
@@ -122,6 +130,8 @@ afterEach(function (done) {
122130
global.adapter = null;
123131

124132
adapter.destroyAll(User).then(function () {
133+
return adapter.destroyAll(Profile);
134+
}).then(function () {
125135
return adapter.destroyAll(Post);
126136
}).then(function () {
127137
return adapter.destroyAll(Comment);

package.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "js-data-redis",
33
"description": "Redis adapter for js-data.",
4-
"version": "2.0.0",
4+
"version": "2.1.0",
55
"homepage": "http://www.js-data.io/docs/dsredisadapter",
66
"repository": {
77
"type": "git",
@@ -11,12 +11,7 @@
1111
"name": "Jason Dobry",
1212
"email": "[email protected]"
1313
},
14-
"licenses": [
15-
{
16-
"type": "MIT",
17-
"url": "https://github.com/js-data/js-data-redis/blob/master/LICENSE"
18-
}
19-
],
14+
"license": "MIT",
2015
"main": "./dist/js-data-redis.js",
2116
"keywords": [
2217
"data",
@@ -27,9 +22,9 @@
2722
"redis"
2823
],
2924
"devDependencies": {
30-
"babel-core": "5.6.15",
31-
"babel-loader": "5.2.2",
32-
"bluebird": "2.9.30",
25+
"babel-core": "5.6.17",
26+
"babel-loader": "5.3.1",
27+
"bluebird": "2.9.33",
3328
"chai": "3.0.0",
3429
"grunt": "0.4.5",
3530
"grunt-contrib-watch": "0.6.1",

0 commit comments

Comments
 (0)