<commit_before>class HomeController < ApplicationController
  def index
  end

  def start_conversation
    interlocutor = User.find(params[:interlocutor_id])

    #conv = current_user.conversations.joins(:conversation_users).
    #    where(:conversation_users => {:user_id => interlocutor.id}).first

    #conv =  ConversationUser.where(:user_id => interlocutor.id).
    #    where(:conversation_id => current_user.conversations).first.conversation

    conv =  interlocutor.conversations.where(:id => current_user.conversations).first

    if conv.nil?
      conv = Conversation.new(
          :users => [current_user, interlocutor]
      )
      conv.save!
    end

    redirect_to conversation_path(conv)
  end

end<commit_msg>fix mass-assignment fault when starting new conv<commit_after>class HomeController < ApplicationController
  def index
  end

  def start_conversation
    interlocutor = User.find(params[:interlocutor_id])

    #conv = current_user.conversations.joins(:conversation_users).
    #    where(:conversation_users => {:user_id => interlocutor.id}).first

    #conv =  ConversationUser.where(:user_id => interlocutor.id).
    #    where(:conversation_id => current_user.conversations).first.conversation

    conv =  interlocutor.conversations.where(:id => current_user.conversations).first

    if conv.nil?
      conv = Conversation.new
      conv.users = [current_user, interlocutor]
      conv.save!
    end

    redirect_to conversation_path(conv)
  end

end
{'fraction_non_alphanumeric': 0.10208193418401612, 'fraction_numerical': 0.0, 'mean_word_length': 3.806451612903226, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '4719285', 'n_tokens_mistral': 473, 'n_tokens_neox': 440, 'n_words': 77}