You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: can_move_repository_storage.rb
    path of file: ./repos/gitlabhq/app/models/concerns
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module CanMoveRepositoryStorage
  extend ActiveSupport::Concern

  RepositoryReadOnlyError = Class.new(StandardError)

  # Tries to set repository as read_only, checking for existing 
    
  def set_repository_read_only!(skip_git_transfer_check: false)
    with_lock do
      raise RepositoryReadOnlyError, _('Git transfer in progress') if
        !skip_git_transfer_check && git_transfer_in_progress?

      raise RepositoryReadOnlyError, _('Repository already read-only') if
        safe_read_repository_read_only_column

      raise ActiveRecord::RecordNotSaved, _('Database update failed') unless
        update_repository_read_only_column(true)

      nil
    end
  end