class ChangePermissionsCustomFolders < ActiveRecord::DataMigration
  def up
    say 'Changing permissions of custom folders for existing records...'

    project_manager_directory_ids = Directory.where(permissions: "Account Managers Only").map(&:id)
    account_manager_directory_ids = Directory.where(permissions: "Account Managers & Project Managers").map(&:id)

    Directory.where(id: project_manager_directory_ids).update_all(permissions: "Account Managers & Project Managers")
    Directory.where(id: account_manager_directory_ids).update_all(permissions: "Account Managers Only")

    say 'Done'
  end
end