<commit_before>class QuestionsController < ApplicationController
  def index
  end

  def new
    if logged_in?
      @question = Question.new
    else
      redirect_to root_path
    end
  end

  def create
    if logged_in?
      @question = Question.new(params[:question].permit(:title, :content))
      @question.asker_id = current_user.id
      if @question.save
        redirect_to question_path(@question)
      else
        flash[:notice] = @question.errors.full_messages.join(", ")
        render :new
      end
    else
      redirect_to root_path
    end
  end

  def show
    @question = Question.find_by(id: params[:id])
    @question.update_attributes(:view_count, @question.view_count + 1)
    @answer = Answer.new
  end
end<commit_msg>Fix update_attribute field<commit_after>class QuestionsController < ApplicationController
  def index
  end

  def new
    if logged_in?
      @question = Question.new
    else
      redirect_to root_path
    end
  end

  def create
    if logged_in?
      @question = Question.new(params[:question].permit(:title, :content))
      @question.asker_id = current_user.id
      if @question.save
        redirect_to question_path(@question)
      else
        flash[:notice] = @question.errors.full_messages.join(", ")
        render :new
      end
    else
      redirect_to root_path
    end
  end

  def show
    @question = Question.find_by(id: params[:id])
    @question.update_attributes(view_count: (@question.view_count + 1))
    @answer = Answer.new
  end
end
{'fraction_non_alphanumeric': 0.08905013192612138, 'fraction_numerical': 0.0013192612137203166, 'mean_word_length': 2.745679012345679, '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': '353481', 'n_tokens_mistral': 463, 'n_tokens_neox': 456, 'n_words': 107}