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: user_role_request.rb
    path of file: ./repos/coursemology2/app/models/instance
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
class Instance::UserRoleRequest < ApplicationRecord
  include Wor
    
  def approve(_ = nil)
    self.confirmed_at = Time.zone.now
    self.confirmer = User.stamper

    instance_user = InstanceUser.find_or_initialize_by(instance_id: instance_id, user_id: user_id)
    instance_user.role = role

    success = self.class.transaction do
      raise ActiveRecord::Rollback unless instance_user.save

      true
    end
    [success, instance_user]
  end