alphagov/whitehall — pull request #53 by chrismdp (2012-10-22 13:40:30+00:00)
Title: Tie attachment metadata to edition

*Please don't merge until you've had a chance to look through the data migration to ensure that the assets are preserved correctly. This migration assumes that the migrating machine has write access to both the source and target uploads folders.*

This commit extracts all the 'file-specific' information from Attachment and adds it to a new class: AttachmentData. The Attachment class is now one-per-edition, allowing title updates to work correctly.

I've deliberately left the tests with duplicate factory and attribute setup in them, and used the refactor to understand the way the tests work better. There's a lot of work to be done to clean them up, but I wanted to keep this change to a reasonable size.