<commit_before>class WorkoutsController < ApplicationController
  def new
    @workout = Workout.generate current_user
  end

  def update
    @workout = Workout.find params[:id]
    workout_params[:measurements_attributes].each do |_, measurement_params|
      measurement = Measurement.find(measurement_params.delete :id)
      measurement.update_attributes measurement_params
      binding.pry #does the meas have a wo
    end
    if @workout.save
      redirect_to @workout
    else
      render :new
    end
  end

  def show
    @workout = Workout.find params[:id]
  end

  private
  def workout_params
    params.require(:workout).permit measurements_attributes: [:id, :unit, :value]
  end

end
<commit_msg>This is not the binding.pry you're looking for *waves hand*<commit_after>class WorkoutsController < ApplicationController
  def new
    @workout = Workout.generate current_user
  end

  def update
    @workout = Workout.find params[:id]
    workout_params[:measurements_attributes].each do |_, measurement_params|
      measurement = Measurement.find(measurement_params.delete :id)
      measurement.update_attributes measurement_params
    end
    if @workout.save
      redirect_to @workout
    else
      render :new
    end
  end

  def show
    @workout = Workout.find params[:id]
  end

  private
  def workout_params
    params.require(:workout).permit measurements_attributes: [:id, :unit, :value]
  end

end

{'fraction_non_alphanumeric': 0.07407407407407407, 'fraction_numerical': 0.0, 'mean_word_length': 3.5173501577287065, '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': '3853938', 'n_tokens_mistral': 429, 'n_tokens_neox': 422, 'n_words': 112}