alphagov/whitehall — pull request #125 by edds (2013-01-07 10:26:31+00:00)
Title: Clarification and normalisation of dates

There are a couple of things in here which should hopefully clarify and normalise how we handle dates every edition should have:

- `public_timestamp` - this is effectively a rename of `timestamp_for_sorting` it contains the single date that should be displayed and used for sorting. It is generated in a `before_save` on editions and lets each edition type define what date is used for it.
- `major_change_published_at` - this is effectively a rename of `published_at` but it better describes what the column contains.
- `first_public_at` - this is a method which should return a `DateTime` describing when an edition was first made public. That can be either public on Inside Government or public elsewhere. It is often editable in the admin and sometimes uses a date attribute on the edition (for example consultation opening date).

Atom feeds have been updated to use the `first_public_at` and `public_timestamp` dates which are reliable dates for all document types.

The data for `first_published_at` has been deleted for consultations, publications and speeches. The data will never get called and will no longer be inserted. It makes it clearer what is going on if you are looking in the database.

The JSON feeds now expose `public_timestamp` for the data insights team rather than `updated_at` as that is a date we should never use or expose.