@@ -1410,7 +1410,7 @@ module.exports = function(AV) {
14101410 var newArguments = [ className ] . concat ( _ . toArray ( arguments ) ) ;
14111411 return AV . Object . extend . apply ( NewClassObject , newArguments ) ;
14121412 } ;
1413- NewClassObject [ 'new' ] = function ( attributes , options ) {
1413+ NewClassObject [ 'new' ] = function ( attributes , options ) {
14141414 return new NewClassObject ( attributes , options ) ;
14151415 } ;
14161416 AV . Object . _classMap [ className ] = NewClassObject ;
@@ -1419,7 +1419,7 @@ module.exports = function(AV) {
14191419
14201420 // ES6 class syntax support
14211421 Object . defineProperty ( AV . Object . prototype , 'className' , {
1422- get : function ( ) {
1422+ get : function ( ) {
14231423 const className = this . _className || this . constructor . _LCClassName || this . constructor . name ;
14241424 // If someone tries to subclass "User", coerce it to the right type.
14251425 if ( className === "User" ) {
@@ -1453,6 +1453,12 @@ module.exports = function(AV) {
14531453 AV . Object . _classMap [ className ] = klass ;
14541454 } ;
14551455
1456+ Object . defineProperty ( AV . Object , 'query' , {
1457+ get ( ) {
1458+ return new AV . Query ( this . prototype . className ) ;
1459+ } ,
1460+ } ) ;
1461+
14561462 AV . Object . _findUnsavedChildren = function ( object , children , files ) {
14571463 AV . _traverse ( object , function ( object ) {
14581464 if ( object instanceof AV . Object ) {
0 commit comments