alphagov/whitehall — pull request #988 by tekin (2013-10-24 10:20:17+00:00)
Title: Data migration to fix failed archivings

There are a small handful of documents that have multiple "published" editions. This data migration repairs things, archiving all but the most recently published edition.

For a period, we had validations that meant archived editions were not passing validation. This should have meant that a publishing attempt would fail because the archiving of previous editions would blow up, but because `EditionWorkflowController` rescues `ActiveRecord::RecordInvalid`, we were publishing the new edition and
carrying on, despite the exception thrown during the archive attempt. The validations have been corrected now, so we shouldn't see this anymore, but we should still remove the `rescue_from` from the controller once we have reliable service objects for all workflow actions.