<commit_before>class RatesController < ApplicationController
  def create
    value = Integer(params[:value])
    submission_id = Integer(params[:submission_id])
    user_id = current_user.id

    rate_creator = RateCreator.build(value, submission_id, user_id)
    rate_creator.call
    if !rate_creator.success?
      flash[:error] = rate_creator.errors
    end

    redirect_to :back
  end
end<commit_msg>Add notice that rate was succesfully created<commit_after>class RatesController < ApplicationController
  def create
    value = Integer(params[:value])
    submission_id = Integer(params[:submission_id])
    user_id = current_user.id

    rate_creator = RateCreator.build(value, submission_id, user_id)
    rate_creator.call
    if !rate_creator.success?
      flash[:error] = rate_creator.errors
      redirect_to :back
    else
      redirect_to :back, notice: 'Rate was successfully created.'
    end
  end
end
{'fraction_non_alphanumeric': 0.08034744842562432, 'fraction_numerical': 0.0, 'mean_word_length': 3.983783783783784, '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': '4313945', 'n_tokens_mistral': 281, 'n_tokens_neox': 277, 'n_words': 63}