<commit_before>class Polls::QuestionsController < ApplicationController

  load_and_authorize_resource :poll
  load_and_authorize_resource :question, class: 'Poll::Question'

  has_orders %w{most_voted newest oldest}, only: :show

  def answer
    answer = @question.answers.find_or_initialize_by(author: current_user)

    answer.answer = params[:answer]
    answer.save!
    answer.record_voter_participation

    @answers_by_question_id = { @question.id => params[:answer] }
  end

end<commit_msg>Touch answer model to force the updated_at value update<commit_after>class Polls::QuestionsController < ApplicationController

  load_and_authorize_resource :poll
  load_and_authorize_resource :question, class: 'Poll::Question'

  has_orders %w{most_voted newest oldest}, only: :show

  def answer
    answer = @question.answers.find_or_initialize_by(author: current_user)

    answer.answer = params[:answer]
    answer.touch if answer.persisted?
    answer.save!
    answer.record_voter_participation

    @answers_by_question_id = { @question.id => params[:answer] }
  end

end
{'fraction_non_alphanumeric': 0.08796296296296297, 'fraction_numerical': 0.0, 'mean_word_length': 5.284883720930233, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1360399', 'n_tokens_mistral': 346, 'n_tokens_neox': 327, 'n_words': 68}