   getDelta: ->
     differ = deltasLib.makeJSONDiffer()
     differ.diff @_revertAttributes, @attributes
-    
+
   getDeltaWith: (otherModel) ->
     differ = deltasLib.makeJSONDiffer()
     differ.diff @attributes, otherModel.attributes

    @loading = false
    @markToRevert()
    @loadFromBackup()
    
  getNormalizedURL: -> "#{@urlRoot}/#{@id}"

  set: ->

    @set 'editPath', document.location.pathname
    options ?= {}
    success = options.success
    error = options.error
    options.success = (model, res) =>
      @trigger "save:success", @
      success(@, res) if success
      @markToRevert()
      @clearBackup()
    options.error = (model, res) =>
      error(@, res) if error
      errorMessage = "Error saving #{@get('name') ? @type()}"
      console.error errorMessage, res.responseJSON
      noty text: "#{errorMessage}: #{res.status} #{res.statusText}", layout: 'topCenter', type: 'error', killer: false, timeout: 10000
    @trigger "save", @
    return super attrs, options

