<commit_before># frozen_string_literal: true
class DamagesController < ApplicationController
  before_action :find_damage, only: [:show, :edit]

  def show; end

  def index
    @damages = Damage.all
  end

  def new
    @damage = Damage.new(new_params)
    flash[:danger] = 'You Are Creating A Damage Without An Attached Incurred Incidental' unless @damage.incurred_incidental
  end

  def create
    @damage = Damage.create(damage_params)

    if @damage.save
      flash[:success] = 'Damage successfully created'
      redirect_to @damage
    else
      flash[:warning] = 'Error creating Damage'
      render 'new'
    end
  end

  def edit; end

  def update
    if @damage.update(damage_params)
      flash[:success] = 'Damage successfully updated'
      redirect_to @damage
    else<commit_msg>fix #233<commit_after># frozen_string_literal: true
class DamagesController < ApplicationController
  before_action :find_damage, only: [:show, :edit, :update]

  def show; end

  def index
    @damages = Damage.all
  end

  def new
    @damage = Damage.new(new_params)
    flash[:danger] = 'You Are Creating A Damage Without An Attached Incurred Incidental' unless @damage.incurred_incidental
  end

  def create
    @damage = Damage.create(damage_params)

    if @damage.save
      flash[:success] = 'Damage successfully created'
      redirect_to @damage
    else
      flash[:warning] = 'Error creating Damage'
      render 'new'
    end
  end

  def edit; end

  def update
    if @damage.update(damage_params)
      flash[:success] = 'Damage successfully updated'
      redirect_to @damage
    else
{'fraction_non_alphanumeric': 0.08291770573566085, 'fraction_numerical': 0.0018703241895261845, 'mean_word_length': 3.326145552560647, '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': '6871585', 'n_tokens_mistral': 524, 'n_tokens_neox': 491, 'n_words': 145}