@@ -334,6 +334,16 @@ module.exports = function(AV) {
334334 return false ;
335335 } ,
336336
337+ /**
338+ * Returns the keys of the modified attribute since its last save/refresh.
339+ * @return {String[] }
340+ */
341+ dirtyKeys : function ( ) {
342+ this . _refreshCache ( ) ;
343+ var currentChanges = _ . last ( this . _opSetQueue ) ;
344+ return _ . keys ( currentChanges ) ;
345+ } ,
346+
337347 /**
338348 * Gets a Pointer referencing this Object.
339349 * @private
@@ -1227,42 +1237,6 @@ module.exports = function(AV) {
12271237 return this ;
12281238 } ,
12291239
1230- /**
1231- * Determine if the model has changed since the last <code>"change"</code>
1232- * event. If you specify an attribute name, determine if that attribute
1233- * has changed.
1234- * @param {String } attr Optional attribute name
1235- * @return {Boolean }
1236- */
1237- hasChanged : function ( attr ) {
1238- if ( ! arguments . length ) {
1239- return ! _ . isEmpty ( this . changed ) ;
1240- }
1241- return this . changed && _ . has ( this . changed , attr ) ;
1242- } ,
1243-
1244- /**
1245- * Returns an object containing all the attributes that have changed, or
1246- * false if there are no changed attributes. Useful for determining what
1247- * parts of a view need to be updated and/or what attributes need to be
1248- * persisted to the server. Unset attributes will be set to undefined.
1249- * You can also pass an attributes object to diff against the model,
1250- * determining if there *would be* a change.
1251- */
1252- changedAttributes : function ( diff ) {
1253- if ( ! diff ) {
1254- return this . hasChanged ( ) ? _ . clone ( this . changed ) : false ;
1255- }
1256- var changed = { } ;
1257- var old = this . _previousAttributes ;
1258- AV . _objectEach ( diff , function ( diffVal , attr ) {
1259- if ( ! _ . isEqual ( old [ attr ] , diffVal ) ) {
1260- changed [ attr ] = diffVal ;
1261- }
1262- } ) ;
1263- return changed ;
1264- } ,
1265-
12661240 /**
12671241 * Gets the previous value of an attribute, recorded at the time the last
12681242 * <code>"change"</code> event was fired.
0 commit comments