<commit_before>class ThemesController < ApplicationController

  before_filter :login_required

  no_design_blocks

  # attr_reader :target

  def target
    @target
  end

  def index
    @environment = environment
    @themes = (environment.themes + Theme.approved_themes(target)).sort_by{ |t| t.name }.uniq

    @current_theme = target.theme

    @layout_templates = LayoutTemplate.all
    @current_template = target.layout_template
  end

  def set
    target.update_theme(params[:id])
    redirect_to :action => 'index'
  end

  def unset
    if target.kind_of?(Environment)
      target.update_theme('default')
    else
      target.update_theme(nil)
    end
    redirect_to :action => 'index'
  end

  def set_layout_template
    target.update_layout_template(params[:id])
    redirect_to :action => 'index'
  end

end<commit_msg>Fix uniq use<commit_after>class ThemesController < ApplicationController

  before_filter :login_required

  no_design_blocks

  # attr_reader :target

  def target
    @target
  end

  def index
    @environment = environment
    @themes = (environment.themes + Theme.approved_themes(target)).sort_by{ |t| t.name }.uniq{ |t| t.id }

    @current_theme = target.theme

    @layout_templates = LayoutTemplate.all
    @current_template = target.layout_template
  end

  def set
    target.update_theme(params[:id])
    redirect_to :action => 'index'
  end

  def unset
    if target.kind_of?(Environment)
      target.update_theme('default')
    else
      target.update_theme(nil)
    end
    redirect_to :action => 'index'
  end

  def set_layout_template
    target.update_layout_template(params[:id])
    redirect_to :action => 'index'
  end

end
{'fraction_non_alphanumeric': 0.09080118694362017, 'fraction_numerical': 0.0, 'mean_word_length': 3.496, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6628784', 'n_tokens_mistral': 544, 'n_tokens_neox': 519, 'n_words': 115}