<commit_before>class Api::ApplicationInstancesController < Api::ApiApplicationController

  load_and_authorize_resource :application
  load_and_authorize_resource :application_instance, through: :application

  before_action :set_configs, only: [:create, :update]

  def index
    application_instances = @application_instances.map do |app|
      app_json = app.as_json(include: :site)
      app_json["lti_config_xml"] = app.lti_config_xml
      app_json
    end

    render json: application_instances
  end

  def show
    respond_with_json
  end

  def create
    @application_instance.domain =
      "#{@application_instance.lti_key}.#{Rails.application.secrets.application_root_domain}"
    @application_instance.save!
    respond_with_json
  end

  def update
    @application_instance.update(application_instance_params)
    respond_with_json
  end

  def destroy
    @application_instance.destroy
    render json: { head: :ok }<commit_msg>use autofill domain<commit_after>class Api::ApplicationInstancesController < Api::ApiApplicationController

  load_and_authorize_resource :application
  load_and_authorize_resource :application_instance, through: :application

  before_action :set_configs, only: [:create, :update]

  def index
    application_instances = @application_instances.map do |app|
      app_json = app.as_json(include: :site)
      app_json["lti_config_xml"] = app.lti_config_xml
      app_json
    end

    render json: application_instances
  end

  def show
    respond_with_json
  end

  def create
    @application_instance.save!
    respond_with_json
  end

  def update
    @application_instance.update(application_instance_params)
    respond_with_json
  end

  def destroy
    @application_instance.destroy
    render json: { head: :ok }
{'fraction_non_alphanumeric': 0.06945228684359118, 'fraction_numerical': 0.0, 'mean_word_length': 4.402439024390244, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7245739', 'n_tokens_mistral': 544, 'n_tokens_neox': 532, 'n_words': 108}