maccman/spine — pull request #152 by fuzzygroove (2011-12-02 07:05:29+00:00)
Title: Check for empty dataset after parsing JSON

This little fix checks for an empty data object both before *and* after calling `@method.fromJSON`.

I'm not sure it's really even needed before, but I left it there for compatibility just in case someone's not checking for that in their override.

I'm using an API that returns details confirming a delete, but the json response doesn't contain the actual deleted record. In this situation `data` is not empty *before* calling a custom `@method.fromJSON`, but is empty after, which breaks the existing logic.