Migration and model changes for CorporateInfoPages.

Change CorporateInformationPage to be an Edition. As a general principle, trying
to avoid adding fields to the Edition base model: so far the exception is
corporate_information_page_type_id, which follows the precedent of
publication_type_id to point to the fake model.

Slugs in CIPs are meaningless, as they depend on the CIPType and are only
unique within each organisation. As a consequence, the migration does not
create a document slug at all, relying on the default behaviour of using the
db id.

Previously CIP had a polymorphic belongs_to relationship to organisation and
worldwide_organisation. Here we reuse the existing ::Organisation and
::WorldwideOrganisation mixins, which are actually many-to-many, but we add
validation to ensure that only one organisation is allowed overall.
Controller changes for CorporateInformationPages

Inherit from DocumentsController rather than directly from
PublicFacingController.

Override find_document_or_edition_for_public, which on the base class searches
documents by slug: in CIP slugs are meaningless, so we use the Organisation
to search by CIPType slug.
Fix migration of CIP attachments.

Also remove commented code and fix a reference to old type field.
Fix conversion of translations in CIP migration.
Create and edit CIPs in admin.

Where possible most model-specific functionality has been removed in favour of
that from the Edition model/controller/views.

URL calculation is a problem because the CIP resource is nested inside
Organisation, unlike any other Edition subclass. Various CIP-specific route
helpers have had to be defined to deal with this.
Remove CIP.by_type which is not being used.

Method was causing admin filter to fail as it shadowed Edition.by_type which had
a different meaning.
Add ordering and hide_type to EditionFilter.

These will be used in the CorporateInformationPage index controller.

Also add CorporateInformationPage to list of edition types for filtering.
Use EditionFilter on CIP index page.

Params are hard-coded as the page only ever displays the full list of CIPs for
an organisation.
Use has_one :through for CIP organisation.

Add method on Organisation to build CIP with linking record.
Make CIP relationships work with worldwide orgs.
Create fake filter class for CIP admin index.

Remove ordering addition to real filter class that was added just for CIP.
Move header creation in CIP frontend controller.

This now overrides the superclass method, preventing duplication which was
failing when called with a Worldwide CIP.
Make route helpers work with Worldwide CIPs.

Undo some of the previous changes to the helper and determine the route name
dependent on whether the CIP is associated with an Organisation or a
WorldwideOrganisation.

Also remove duplicated logic in document_path and make that call document_url
with routing_type: path.
Attachment and translation fixes for CIP migration

* Create new Attachment instances rather than converting old ones to make it
easier to roll back. Keep old AttachmentData.
* Don't set irrelevant lead organisation attributes.
* Style fix on translation logic.
* Override summary_required on model and don't set empty summaries in migration.
Search indexing for CIPs.

Make title reference in Edition point to overridable search_title method, and
override in CIP to return title_prefix_organisation_name.

Add display_type override in CIP.

Remove now-unused methods in CIP.
Removed commented and unused code in CIP.
Remove redundant workaround in CIP controller.
Remove CIP from searchable non-edition classes.
Don't autosave CIP organisation associations.

This fixes an issue where saving a CIP triggers re-indexing all of the
MinisterialRoles attached to the associated Organisation.
Only index CIPs with live Organisations.

Add search_only method in Edition which is referenced by :only key in
searchable, and override in CIP to join on organisations with govuk_status: live