examples/todos/js/backbonefire.js
function(model) {
        var modelObj = model.changedAttributes();
        _.each(model.changed, function(value, key) {
          if (typeof value === 'undefined' || value === null) {
            if (key == 'id') {
              delete modelObj[key];
            } else {
              modelObj[key] = null;
            }
          }
        });

        return modelObj;
      }
function(model) {
        var modelObj = model.changedAttributes();
        _.each(model.changed, function(value, key) {
          if (typeof value === 'undefined' || value === null) {
            if (key == 'id') {
              delete modelObj[key];
            } else {
              modelObj[key] = null;
            }
          }
        });

        return modelObj;
      }
function ( model ) { var modelObj = model . changedAttributes ( ) ; _ . each ( model . changed , function ( value , key ) { if ( typeof value === 'undefined' || value === null ) { if ( key == 'id' ) { delete modelObj [ key ] ; } else { modelObj [ key ] = null ; } } } ) ; return modelObj ; }
Find the deleted keys and set their values to null
so Firebase properly deletes them.
Find the deleted keys and set their values to null so Firebase properly deletes them .