maccman/spine — pull request #353 by nathanpalmer (2012-08-02 20:52:54+00:00)
Title: Modified recordResponse to pass in the current event

Commit Notes
---------------------
Updated so the ajaxSuccess event is dependent upon successful serialization
Updated so the ajaxFailure event would also trigger upon failed serialization
Deleted the "saved" record if the event was 'create' and it failed

Comments
---------------
I wanted to send this over even if it was purely for a conversation point. We just made this change to get our application to work properly. When models are sent to the server to get created/updated we always return json data that indicates a success or failure. The serialization handles whether it should really be saved. I needed a way for the ajax integration to send out the events at the correct times and remove the saved record if it was on create (since ajax triggers after spine saves successfully)