<commit_before>class Basefact < OurOhm
  include Activity::Subject

  reference :created_by, GraphUser
  reference :opinion, Opinion

  set :people_believes, GraphUser
  set :people_doubts, GraphUser
  set :people_disbelieves, GraphUser
  private :people_believes, :people_doubts, :people_disbelieves
  def opinionated_users
    return people_believes | people_doubts | people_disbelieves
  end

  def validate
    assert_present :created_by
  end

  def opiniated(type)
    send(:"people_#{Opinion.real_for(type)}")
  end

  def add_opiniated(type, user)
    opiniated(type).add(user)
  end

  def delete_opiniated(type, user)
    opiniated(type).delete(user)
  end

  def opiniated_count(type)
    opiniated(type).size
  end

  def add_opinion(type, user)
    _remove_opinions(user)

    add_opiniated(type,user)
    user.update_opinion(type, self)
    activity(user,Opinion.real_for(type),self)
  end

  def remove_opinions(user)
    _remove_opinions(user)
    activity(user,:removed_opinions,self)
  end

  def _remove_opinions(user)
    user.remove_opinions(self)
    Opinion.types.each do |type|
      delete_opiniated(type,user)
    end
  end
  private :delete
end<commit_msg>removed restriction on delete which required to make this function public again in child classes<commit_after>class Basefact < OurOhm
  include Activity::Subject

  reference :created_by, GraphUser
  reference :opinion, Opinion

  set :people_believes, GraphUser
  set :people_doubts, GraphUser
  set :people_disbelieves, GraphUser
  private :people_believes, :people_doubts, :people_disbelieves
  def opinionated_users
    return people_believes | people_doubts | people_disbelieves
  end

  def validate
    assert_present :created_by
  end

  def opiniated(type)
    send(:"people_#{Opinion.real_for(type)}")
  end

  def add_opiniated(type, user)
    opiniated(type).add(user)
  end

  def delete_opiniated(type, user)
    opiniated(type).delete(user)
  end

  def opiniated_count(type)
    opiniated(type).size
  end

  def add_opinion(type, user)
    _remove_opinions(user)

    add_opiniated(type,user)
    user.update_opinion(type, self)
    activity(user,Opinion.real_for(type),self)
  end

  def remove_opinions(user)
    _remove_opinions(user)
    activity(user,:removed_opinions,self)
  end

  def _remove_opinions(user)
    user.remove_opinions(self)
    Opinion.types.each do |type|
      delete_opiniated(type,user)
    end
  end
end
{'fraction_non_alphanumeric': 0.08103661044837515, 'fraction_numerical': 0.0, 'mean_word_length': 4.392461197339246, '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': '2862730', 'n_tokens_mistral': 904, 'n_tokens_neox': 816, 'n_words': 171}