<commit_before>class PeopleNetworkController < ApplicationController
  before_filter :authenticate_user!
  # TODO add some verification who can destroy people network

  def destroy
    @people_network = PeopleNetwork.find(params[:id])
    trusted_person = @people_network.trusted_person
    EventLog.create_news_event_log(@people_network.person, @people_network.trusted_person, nil, EventType.trust_withdrawn, @people_network)
    PeopleNetwork.involves(@people_network.person).involves(@people_network.trusted_person).limit(2).destroy_all
    @people_network.person.reputation_rating.decrease_trusted_network_count
    @people_network.trusted_person.reputation_rating.decrease_trusted_network_count
    redirect_to trusted_person
  end
end<commit_msg>create event log so the dashboard will know who witdrawn the trust<commit_after>class PeopleNetworkController < ApplicationController
  before_filter :authenticate_user!
  # TODO add some verification who can destroy people network

  def destroy
    @people_network = PeopleNetwork.find(params[:id])
    trusted_person = @people_network.trusted_person
    if @people_network.person == current_user.person
      EventLog.create_news_event_log(@people_network.person, @people_network.trusted_person, nil, EventType.trust_withdrawn, @people_network)
    else
      EventLog.create_news_event_log(@people_network.trusted_person, @people_network.person, nil, EventType.trust_withdrawn, @people_network)
    end
    PeopleNetwork.involves(@people_network.person).involves(@people_network.trusted_person).limit(2).destroy_all
    @people_network.person.reputation_rating.decrease_trusted_network_count
    @people_network.trusted_person.reputation_rating.decrease_trusted_network_count
    redirect_to trusted_person
  end
end
{'fraction_non_alphanumeric': 0.06993795826283136, 'fraction_numerical': 0.0011280315848843769, 'mean_word_length': 6.746724890829694, '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': '5926600', 'n_tokens_mistral': 527, 'n_tokens_neox': 503, 'n_words': 84}