File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,7 +105,11 @@ Table.prototype.count = function(alias) {
105105Table . prototype . select = function ( ) {
106106 //create the query and pass it off
107107 var query = new Query ( this ) ;
108- query . select . apply ( query , arguments ) ;
108+ if ( arguments . length === 0 ) {
109+ query . select . call ( query , this . star ( ) ) ;
110+ } else {
111+ query . select . apply ( query , arguments ) ;
112+ }
109113 return query ;
110114} ;
111115
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ suite('table', function() {
3636 assert . equal ( sel . type , 'QUERY' ) ;
3737 } ) ;
3838
39+ test ( 'creates *-query if no args is provided to select()' , function ( ) {
40+ var sel = table . select ( ) ;
41+ assert . ok ( sel . nodes [ 0 ] . nodes [ 0 ] . star ) ;
42+ } ) ;
43+
3944 test ( 'can be defined' , function ( ) {
4045 var user = Table . define ( {
4146 name : 'user' ,
You can’t perform that action at this time.
0 commit comments