<commit_before>class CollaboratorsController < ApplicationController
  add_breadcrumb I18n.t('activerecord.models.collaborator'), :collaborators_path

  def index
    @collaborators = @current_project.users
  end

  def create
    value = params[:project][:user_ids]
    email = value.split('-').last
    Rails.logger.info email.strip
    user = User.where(email: email.strip).last
    unless @current_project.users.include?(user)
      @current_project.users << user
    end

    respond_to do |format|
      format.js
    end
  end

  def destroy
    email = params[:email]
    user = @current_project.users.where(email: email).last
    @current_project.cards.update_all('assignment_id = null', "assignment_id = #{user.id}")
    unless user == @current_project.owner
      @current_project.users.delete(user)
    end
    respond_to do |format|
      format.js
    end
  end

  private

  def collaboration_params
    params.require(:projects_user).permit(:project_id, :user_id)
  end<commit_msg>#94 Remove unnecessary rails logger<commit_after>class CollaboratorsController < ApplicationController
  add_breadcrumb I18n.t('activerecord.models.collaborator'), :collaborators_path

  def index
    @collaborators = @current_project.users
  end

  def create
    value = params[:project][:user_ids]
    email = value.split('-').last
    user = User.where(email: email.strip).last
    unless @current_project.users.include?(user)
      @current_project.users << user
    end

    respond_to do |format|
      format.js
    end
  end

  def destroy
    email = params[:email]
    user = @current_project.users.where(email: email).last
    @current_project.cards.update_all('assignment_id = null', "assignment_id = #{user.id}")
    unless user == @current_project.owner
      @current_project.users.delete(user)
    end
    respond_to do |format|
      format.js
    end
  end

  private

  def collaboration_params
    params.require(:projects_user).permit(:project_id, :user_id)
  end
{'fraction_non_alphanumeric': 0.10494450050454086, 'fraction_numerical': 0.0030272452068617556, 'mean_word_length': 3.5902777777777777, 'pattern_counts': {'":': 0, '<': 9, '<?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': '3859366', 'n_tokens_mistral': 629, 'n_tokens_neox': 610, 'n_words': 123}