<commit_before>class EntriesController < ApplicationController

  before_action :logged_in_user
  before_action :correct_user

  def index
    @user = User.find(params[:user_id])
    @entries = @user.entries
  end

  def new
    @user = User.find(params[:user_id])
    @entry = @user.entries.new
  end

  def create
    @user = User.find(params[:user_id])
    @entry = @user.entries.new(entry_params)
    if @entry.save
      flash[:success] = "Ok, that's been saved!"
      redirect_to user_entry_path @user, @entry
    else
      flash[:error] = 'There was a problem with the information that you submitted'
      render :new
    end
  end

  def show<commit_msg>Explicitly order entries on created_at<commit_after>class EntriesController < ApplicationController

  before_action :logged_in_user
  before_action :correct_user

  def index
    @user = User.find(params[:user_id])
    @entries = @user.entries.order :created_at
  end

  def new
    @user = User.find(params[:user_id])
    @entry = @user.entries.new
  end

  def create
    @user = User.find(params[:user_id])
    @entry = @user.entries.new(entry_params)
    if @entry.save
      flash[:success] = "Ok, that's been saved!"
      redirect_to user_entry_path @user, @entry
    else
      flash[:error] = 'There was a problem with the information that you submitted'
      render :new
    end
  end

  def show
{'fraction_non_alphanumeric': 0.09905316824471959, 'fraction_numerical': 0.0, 'mean_word_length': 3.3072100313479624, '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': '4807244', 'n_tokens_mistral': 445, 'n_tokens_neox': 432, 'n_words': 116}