Skip to content

Commit 4d3ad7d

Browse files
committed
Update packages
1 parent 0376b7a commit 4d3ad7d

27 files changed

+170
-162
lines changed

lib/ChainFind.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function ChainFind(Model, opts) {
102102
return this;
103103
},
104104
remove: function (cb) {
105-
var keys = _.pluck(opts.keyProperties, 'mapsTo');
105+
var keys = _.map(opts.keyProperties, 'mapsTo');
106106

107107
opts.driver.find(keys, opts.table, prepareConditions(), {
108108
limit : opts.limit,

lib/Model.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ function Model(opts) {
707707
}
708708

709709
// If no keys are defined add the default one
710-
if (opts.keys.length == 0 && !_.any(opts.properties, { key: true })) {
710+
if (opts.keys.length == 0 && !_.some(opts.properties, { key: true })) {
711711
opts.properties[opts.settings.get("properties.primary_key")] = {
712712
type: 'serial', key: true, required: false, klass: 'primary'
713713
};

lib/Settings.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ function Settings(settings) {
4141
return this;
4242
},
4343
get: function (key, def) {
44-
return _.cloneDeep(get(key, def, settings));
44+
var v = get(key, def, settings)
45+
46+
if (v instanceof Function) {
47+
return v;
48+
} else {
49+
return _.cloneDeep(v);
50+
}
4551
},
4652
unset: function () {
4753
for (var i = 0; i < arguments.length; i++) {

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@
4040
"sql-query" : "0.1.26",
4141
"sql-ddl-sync" : "0.3.11",
4242
"hat" : "0.0.3",
43-
"lodash" : "2.4.1",
43+
"lodash" : "4.11.2",
4444
"path-is-absolute" : "1.0.0"
4545
},
4646
"devDependencies": {
47-
"mysql" : "2.9.0",
48-
"pg" : "4.4.3",
49-
"sqlite3" : "3.1.0",
50-
"async" : "1.5.0",
51-
"mocha" : "2.3.3",
52-
"should" : "1.2.2",
53-
"mongodb" : "1.3.19",
54-
"glob" : "5.0.15"
47+
"mysql" : "2.10.2",
48+
"pg" : "4.5.5",
49+
"sqlite3" : "3.1.3",
50+
"async" : "1.5.2",
51+
"mocha" : "2.4.5",
52+
"should" : "8.3.1",
53+
"mongodb" : "1.4.10",
54+
"glob" : "7.0.3"
5555
},
5656
"optionalDependencies": {}
5757
}

test/integration/association-extend.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe("Model.extendsTo()", function() {
6868

6969
John.removeAddress(function () {
7070
John.hasAddress(function (err, hasAddress) {
71-
err.should.be.a("object");
71+
err.should.be.a.Object();
7272
hasAddress.should.equal(false);
7373

7474
return done();
@@ -82,7 +82,7 @@ describe("Model.extendsTo()", function() {
8282
name: "Jane"
8383
});
8484
Jane.hasAddress(function (err, hasAddress) {
85-
err.should.be.a("object");
85+
err.should.be.a.Object();
8686
err.should.have.property("code", ORM.ErrorCodes.NOT_DEFINED);
8787

8888
return done();
@@ -99,7 +99,7 @@ describe("Model.extendsTo()", function() {
9999

100100
John.getAddress(function (err, Address) {
101101
should.equal(err, null);
102-
Address.should.be.a("object");
102+
Address.should.be.a.Object();
103103
Address.should.have.property("street", "Liberty");
104104

105105
return done();
@@ -113,7 +113,7 @@ describe("Model.extendsTo()", function() {
113113

114114
John.removeAddress(function () {
115115
John.getAddress(function (err, Address) {
116-
err.should.be.a("object");
116+
err.should.be.a.Object();
117117
err.should.have.property("code", ORM.ErrorCodes.NOT_FOUND);
118118

119119
return done();
@@ -127,7 +127,7 @@ describe("Model.extendsTo()", function() {
127127
name: "Jane"
128128
});
129129
Jane.getAddress(function (err, Address) {
130-
err.should.be.a("object");
130+
err.should.be.a.Object();
131131
err.should.have.property("code", ORM.ErrorCodes.NOT_DEFINED);
132132

133133
return done();
@@ -156,7 +156,7 @@ describe("Model.extendsTo()", function() {
156156

157157
John.getAddress(function (err, Address) {
158158
should.equal(err, null);
159-
Address.should.be.a("object");
159+
Address.should.be.a.Object();
160160
Address.should.have.property("street", addr.street);
161161

162162
PersonAddress.find({ number: 123 }).count(function (err, c) {
@@ -207,7 +207,7 @@ describe("Model.extendsTo()", function() {
207207
name: "Jane"
208208
});
209209
Jane.removeAddress(function (err) {
210-
err.should.be.a("object");
210+
err.should.be.a.Object();
211211
err.should.have.property("code", ORM.ErrorCodes.NOT_DEFINED);
212212

213213
return done();
@@ -242,7 +242,7 @@ describe("Model.extendsTo()", function() {
242242
var ChainFind = Person.findByAddress({
243243
number: 123
244244
});
245-
ChainFind.run.should.be.a("function");
245+
ChainFind.run.should.be.a.Function();
246246

247247
return done();
248248
});

test/integration/association-hasmany-extra.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe("hasMany extra properties", function() {
6363

6464
John.pets[0].should.have.property("name");
6565
John.pets[0].should.have.property("extra");
66-
John.pets[0].extra.should.be.a("object");
66+
John.pets[0].extra.should.be.a.Object();
6767
John.pets[0].extra.should.have.property("since");
6868
should(John.pets[0].extra.since instanceof Date);
6969

test/integration/association-hasmany-hooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe("hasMany hooks", function() {
6969
before(setup({}, {
7070
hooks : {
7171
beforeSave: function (next) {
72-
next.should.be.a("function");
72+
next.should.be.a.Function();
7373
return next();
7474
}
7575
}

test/integration/association-hasmany-mapsto.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe("hasMany with mapsTo", function () {
8989
Person.find({ firstName: "John" }).first(function (err, John) {
9090
should.equal(err, null);
9191

92-
John.should.not.have.property("pets");
92+
should.equal(John.pets, null);
9393
return done();
9494
});
9595
});
@@ -177,11 +177,11 @@ describe("hasMany with mapsTo", function () {
177177

178178
var chain = people[0].getPets({ firstName: "Mutt" });
179179

180-
chain.should.be.a("object");
181-
chain.find.should.be.a("function");
182-
chain.only.should.be.a("function");
183-
chain.limit.should.be.a("function");
184-
chain.order.should.be.a("function");
180+
chain.should.be.a.Object();
181+
chain.find.should.be.a.Function();
182+
chain.only.should.be.a.Function();
183+
chain.limit.should.be.a.Function();
184+
chain.order.should.be.a.Function();
185185

186186
return done();
187187
});

test/integration/association-hasmany.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ describe("hasMany", function () {
158158

159159
var chain = people[0].getPets({ name: "Mutt" });
160160

161-
chain.should.be.a("object");
162-
chain.find.should.be.a("function");
163-
chain.only.should.be.a("function");
164-
chain.limit.should.be.a("function");
165-
chain.order.should.be.a("function");
161+
chain.should.be.a.Object();
162+
chain.find.should.be.a.Function();
163+
chain.only.should.be.a.Function();
164+
chain.limit.should.be.a.Function();
165+
chain.order.should.be.a.Function();
166166

167167
return done();
168168
});

test/integration/association-hasone-reverse.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ describe("hasOne", function () {
5757
var person = Person(1);
5858
var pet = Pet(1);
5959

60-
person.getPet.should.be.a("function");
61-
person.setPet.should.be.a("function");
62-
person.removePet.should.be.a("function");
63-
person.hasPet.should.be.a("function");
60+
person.getPet.should.be.a.Function();
61+
person.setPet.should.be.a.Function();
62+
person.removePet.should.be.a.Function();
63+
person.hasPet.should.be.a.Function();
6464

65-
pet.getOwners.should.be.a("function");
66-
pet.setOwners.should.be.a("function");
67-
pet.hasOwners.should.be.a("function");
65+
pet.getOwners.should.be.a.Function();
66+
pet.setOwners.should.be.a.Function();
67+
pet.hasOwners.should.be.a.Function();
6868

6969
return done();
7070
});
@@ -234,7 +234,7 @@ describe("hasOne", function () {
234234
var ChainFind = Pet.findByOwners({
235235
name: "John Doe"
236236
});
237-
ChainFind.run.should.be.a("function");
237+
ChainFind.run.should.be.a.Function();
238238

239239
return done();
240240
});

0 commit comments

Comments
 (0)