alphagov/whitehall — pull request #107 by h-lame (2012-12-19 09:45:10+00:00)
Title: Feeds suitable for govdelivery

If the govdelivery_version query string parameter is present and looks truthy ("1", "on", "true", "yes") then the atom feeds will:

* put the summary of a document into the content element
* prefix the title element with the display_type of the document

Also taken the opportunity to standardise how we turn a document into a feed entry with some helpers so that all feeds now:

* use timestamp_for_sorting for the published element
* use timestamp_for_update for the updated element
* provide a summary element (populated by the summary of the document)
* provide a category element (populated by the display_type of the document)
* use the timestamp_for_update of the first document as the updated element for the entire feed,
* unless no documents are present, in which case use Time.current or a supplied value

NOTE: timestamp_for_update is a method that by default passes through to published_at. We use this because published_at is often overridden by a presenter to return a String and Rails' atom feed builder wants a Date-ish object. Also it means any Edition types that want to use a different value to represent their updated timestamp can override the method.