kytrinyx/exercism.io — pull request #587 by andrzejkrzywda (2013-08-20 22:48:19+00:00)
Title: api/submit - the backend part for unsubmitting the last submission

This is the backend API endpoint for the future ```exercism unsubmit``` command. This command is part of the fix for #135.

This API endpoint can also be used in the future JavaScript code for deleting the last submission via the web UI.

The following rules are applied:
```
raise NothingToUnsubmit.new if submission.nil?
raise SubmissionHasNits.new if submission.this_version_has_nits?
raise SubmissionApproved.new if submission.approved?
raise SubmissionTooOld.new if submission.older_than?(TIMEOUT)
```