class ChangeLgsl230To107OnLocalTransaction < Mongoid::Migration
  def self.up
    # "Editing of an edition with an Archived artefact is not allowed".
    Edition.skip_callback(:save, :before, :check_for_archived_artefact)

    sheltered_housing_editions = LocalTransactionEdition.where(lgsl_code: 230)
    sheltered_housing_editions.each do |edition|
      edition.lgsl_code = 107
      edition.save!(validate: false)
    end
  end

  def self.down
  end
end
Change sheltered housing transaction to LGSL 107
Change sheltered housing transaction to LGSL 107

We want to use LGSL 107 (instead of 230) for the sheltered housing local
transaction as it is supported in England and Wales.

This migration is one of the last bits of the puzzle from this Trello card:
https://trello.com/c/Zb42F6Jq/417-switch-local-transaction-for-apply-for-sheltered-housing-from-one-lgsl-to-another-3
