alphagov/panopticon — pull request #57 by jamiecobbett (2013-02-20 17:08:12+00:00)
Title: Delete artefacts when changed to nonindexed kinds

We have had some artefacts created (incorrectly) as Answers when they should
have been CompletedTransactions. These were not removed automatically. This
change would ensure that they are in future.

I haven't written any tests for which I feel bad, though I have tested by hand. I did try moving this logic into RummageableArtefact to make it more testable, but the use of ActiveModel's dirty tracking (``kind_was``) was a bit too hidden and distant, whereas in the context of an observer it feels sane.