instructure/canvas-lms — pull request #152 by blt04 (2012-03-28 23:44:53+00:00)
Title: Delete attached quiz/topic when assignment destroyed

When an assignment attached to a quiz or discussion topic is deleted, the corresponding quiz/topic remains.

This can lead to bugs. For example, after deleting a discussion topic assignment, the *Edit Assignment Settings* button on the discussion page results in an exception because the assignment no longer exists.

This pull requests fixes the `Assignment.destroy` behavior and adds corresponding specs.

As a side note, is this the correct behavior? The existing code implies the corresponding quiz/topic **should** be deleted, however It seems reasonable that a professor might actually want to remove the assignment associated with a topic/quiz **without** removing the actual topic/quiz. Thoughts?