Update query changes.
diff --git a/lib/query.js b/lib/query.js
index 87daf7d..8afcb91 100644
--- a/lib/query.js
+++ b/lib/query.js
@@ -118,14 +118,11 @@
// public accessors
Object.defineProperty(self, '_ql', {
get: function() {
- var ql = 'select * '
if (queryString !== undefined) {
- ql = queryString
+ return queryString
} else {
- ql += ((query.length > 0) ? 'where ' + (query || '') : '')
- ql += ((sort !== undefined) ? sort : '')
+ return util.format('select * %s %s', ((query.length > 0) ? 'where ' + (query || '') : ''),((sort !== undefined) ? sort : ''))
}
- return ql
}
})
diff --git a/tests/lib/query.test.js b/tests/lib/query.test.js
index 7ec9cb4..65f9c1a 100644
--- a/tests/lib/query.test.js
+++ b/tests/lib/query.test.js
@@ -33,7 +33,7 @@
})
describe('_ql', function() {
- it('should select * if query or sort are empty or underfined', function() {
+ it('should equal \'select *\' if query or sort are empty or underfined', function() {
var query = new UsergridQuery('cats')
query.should.have.property('_ql').equal('select * ')
})