<commit_before># RESTful controller for Project model.
class ProjectsController < ApplicationController
  before_filter :set_project, only: %i[show edit update destroy]

  def index
    @projects = Project.order(:name).includes(:viewports, :last_sweep)
  end

  def show
    render
  end

  def new
    @project = Project.new(viewport_widths: "320\n1200",
                           url_addresses:   'http://www.example.com/')
  end

  def edit
    render
  end

  def create
    @project = Project.new(project_params)
    if @project.save
      redirect_to @project,
                  notice: t(:model_destroyed,
                            model_name: @project.class.model_name.human)
    else
      render action: 'new'
    end
  end

  def update
    if @project.update_attributes(project_params)<commit_msg>Fix typo in ProjectsController#create that showed 'destroyed' text<commit_after># RESTful controller for Project model.
class ProjectsController < ApplicationController
  before_filter :set_project, only: %i[show edit update destroy]

  def index
    @projects = Project.order(:name).includes(:viewports, :last_sweep)
  end

  def show
    render
  end

  def new
    @project = Project.new(viewport_widths: "320\n1200",
                           url_addresses:   'http://www.example.com/')
  end

  def edit
    render
  end

  def create
    @project = Project.new(project_params)
    if @project.save
      redirect_to @project,
                  notice: t(:model_created,
                            model_name: @project.class.model_name.human(count: 1),
                            count: 1)
    else
      render action: 'new'
    end
  end

  def update
    if @project.update_attributes(project_params)
{'fraction_non_alphanumeric': 0.08473592571096925, 'fraction_numerical': 0.009286128845037725, 'mean_word_length': 2.427435387673956, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6944835', 'n_tokens_mistral': 528, 'n_tokens_neox': 493, 'n_words': 129}