excluded_organisations = %w(DFT DCLG BRAC DSA).map { |a| Organisation.find_by_acronym!(a) }
excluded_organisations << Organisation.find_by_name!('Planning inspectorate')

included_organisations = Organisation.all.reject { |o| excluded_organisations.include?(o) }

MinisterialRoleSearchIndexObserver.while_disabled do
  included_organisations.each do |organisation|
    $stderr.print "Setting status of '#{organisation.name}' to 'joining'..."
    organisation.update_attributes!(govuk_status: 'joining')
    $stderr.puts "[done]"
  end
end

$stderr.print "Re-indexing ministerial roles..."
Rummageable.index(MinisterialRole.search_index, Whitehall.government_search_index_name)
$stderr.puts "[done]"

Set most organisations status to "joining" i.e. "Coming soon".
Set most organisations status to "joining" i.e. "Coming soon".

We want most organisations to be labelled as "Coming soon" ready for
when the 1st departments go live.

Re-indexing of ministerial roles normally happens after every save of an
organisation. I used the `.while_disabled` method I added earlier to
avoid this, but I added a single re-index at the end just to be sure.
