Permalink
Browse files

fix: toJSON error

  • Loading branch information...
XadillaX committed Sep 22, 2016
1 parent d4e41e1 commit 7c3e20d71fc1e7afa93ffb54a18381ba204bab05
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/query.js
  2. +1 −1 test/query.js
@@ -154,10 +154,10 @@ class ToshihikoQuery {
if(options.single && row) {
if(row instanceof Yukari && toJSON) {
row = row.toJSON();
} else if(row instanceof Yukari) {
} else if(!(row instanceof Yukari)) {
const yukari = new Yukari(self.model, "query");
yukari.fillRowFromSource(row, true);
row = yukari;
row = toJSON ? yukari.toJSON() : yukari;
}
} else if(!options.single) {
if(row && row.length) {
@@ -22,7 +22,7 @@ describe("🐣 query", function() {
query.field.should.equal(query.fields);
query.orderBy.should.equal(query.order);

query._fields.should.deepEqual([]);
query._fields.should.deepEqual([ "key1" ]);
query._limit.should.deepEqual([]);
query._order.should.deepEqual([]);
query._updateData.should.deepEqual({});

0 comments on commit 7c3e20d

Please sign in to comment.