<commit_before>class Atmosphere::Admin::TenantsController < Atmosphere::Admin::ApplicationController
  load_and_authorize_resource :tenant,
    class: 'Atmosphere::Tenant'

  # GET /tenants
  def index
    @tenants = @tenants.order(:name)
  end

  # GET /tenants/1
  def show
  end

  # GET /tenants/new
  def new
  end

  # GET /tenants/1/edit
  def edit
  end

  # POST /tenants
  def create
    if @tenant.save
      redirect_to admin_tenants_url(@tenant), notice: 'Tenant was successfully created.'
    else
      render action: 'new'
    end
  end

  # PATCH/PUT /tenants/1
  def update
    if @tenant.update(tenant_params)
      ::Proxy::TenantUrlUpdater.new(@tenant).update if @tenant.proxy_urls_changed?
      ::Proxy::TenantAppliancesUpdater.new(@tenant).update if @tenant.tenant_id_previously_changed?

      redirect_to admin_compute_sites_url(@tenant), notice: 'Tenant was successfully updated.'
    else
      render action: 'edit'
    end
  end

  # DELETE /tenants/1
  def destroy
    @tenant.destroy
    redirect_to admin_compute_sites_url, notice: 'Tenant was successfully destroyed.'
  end

  private
    # Only allow a trusted parameter "white list" through.
    def tenant_params
      params.require(:tenant).permit(
        :tenant_id, :name, :active, :location, :tenant_type,
        :technology, :config, :template_filters,
        :http_proxy_url, :https_proxy_url, :wrangler_url,
        :wrangler_username, :wrangler_password)
    end
end
<commit_msg>Fix wrong urls to Tenants page, fix updater module missing<commit_after>class Atmosphere::Admin::TenantsController < Atmosphere::Admin::ApplicationController
  load_and_authorize_resource :tenant,
    class: 'Atmosphere::Tenant'

  # GET /tenants
  def index
    @tenants = @tenants.order(:name)
  end

  # GET /tenants/1
  def show
  end

  # GET /tenants/new
  def new
  end

  # GET /tenants/1/edit
  def edit
  end

  # POST /tenants
  def create
    if @tenant.save
      redirect_to admin_tenants_url(@tenant), notice: 'Tenant was successfully created.'
    else
      render action: 'new'
    end
  end

  # PATCH/PUT /tenants/1
  def update
    if @tenant.update(tenant_params)
      if @tenant.proxy_urls_changed?
        Atmosphere::Proxy::TenantUrlUpdater.new(@tenant).update
      end
      if @tenant.tenant_id_previously_changed?
        Atmosphere::Proxy::TenantAppliancesUpdater.new(@tenant).update
      end

      redirect_to admin_tenants_url(@tenant), notice: 'Tenant was successfully updated.'
    else
      render action: 'edit'
    end
  end

  # DELETE /tenants/1
  def destroy
    @tenant.destroy
    redirect_to admin_tenants_url, notice: 'Tenant was successfully destroyed.'
  end

  private
    # Only allow a trusted parameter "white list" through.
    def tenant_params
      params.require(:tenant).permit(
        :tenant_id, :name, :active, :location, :tenant_type,
        :technology, :config, :template_filters,
        :http_proxy_url, :https_proxy_url, :wrangler_url,
        :wrangler_username, :wrangler_password)
    end
end

{'fraction_non_alphanumeric': 0.09359605911330049, 'fraction_numerical': 0.002627257799671593, 'mean_word_length': 3.3022598870056497, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6739221', 'n_tokens_mistral': 996, 'n_tokens_neox': 1007, 'n_words': 237}