<commit_before># Offsprings are dependent on users and are the ones that get assigned to shifts
# They can't be assigned themselves, and need the process to be done by the user
class OffspringsController < ApplicationController
  def show
  end

  def new
    @offspring = current_user.offsprings.build
  end

  def create
    @offspring = current_user.offsprings.build(offsprings_params)
    unless @offspring.primary_first?
      redirect_to static_pages_intructions_path
      return
    elsif @offspring.save
      flash[:success] = "Niño añadido"
    else
      flash[:danger] = "No se pudo añadir al niño"
    end
    redirect_to root_path
  end

  def destroy
    offspring = Offspring.find_by_id(params[:id])
    offspring.destroy
    flash[:sucess] = "Niño borrado"
    redirect_to request.referer || root_url
  end

  private

  def offsprings_params
    params.require(:offspring).permit(:first_name, :last_name, :grade)
  end
end
<commit_msg>Manually added changes for rebase in file app/controllers/offsprings_controller.rb<commit_after># Offsprings are dependent on users and are the ones that get assigned to shifts
# They can't be assigned themselves, and need the process to be done by the user
class OffspringsController < ApplicationController
  def show
  end

  def new
    @offspring = current_user.offsprings.build
  end

  def create
    @offspring = current_user.offsprings.build(offsprings_params)
    unless @offspring.primary_first?
      flash[:alert] = "No se puedo añadir al niño"
      redirect_to static_pages_intructions_path
      return
    elsif @offspring.save
      flash[:success] = "Niño añadido"
    else
      flash[:danger] = "No se pudo añadir al niño"
    end
    redirect_to root_path
  end

  def destroy
    offspring = Offspring.find_by_id(params[:id])
    offspring.destroy
    flash[:sucess] = "Niño borrado"
    redirect_to request.referer || root_url
  end

  private

  def offsprings_params
    params.require(:offspring).permit(:first_name, :last_name, :grade)
  end
end

{'fraction_non_alphanumeric': 0.0675542406311637, 'fraction_numerical': 0.0, 'mean_word_length': 3.643020594965675, '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': '1675986', 'n_tokens_mistral': 653, 'n_tokens_neox': 634, 'n_words': 188}