<commit_before>class Role < ActiveRecord::Base
  belongs_to :person
  belongs_to :client

  validates_presence_of :title, :client_id, :person_id

  ADMINISTRATOR = "administrator"
  MODERATOR = "moderator"
  USER = "user"

  validates_inclusion_of :title, :in => [ADMINISTRATOR, MODERATOR, USER], 
                                 :message => "Role title %s is not valid."
  
  def self.find_by_user_and_client_id(user_id, client_id)
    Role.find(:all, :conditions => { :person_id => user_id, :client_id => client_id })
  end
  
  def self.find_by_client_id(client_id)
    Role.find(:all, :conditions => "client_id = '#{client_id}'")
  end
  
  def self.find_by_user_id(user_id)
    Role.find(:all, :conditions => "person_id = '#{user_id}'")
  end
<commit_msg>Muutettu virheviestistä deprekoitunut %s -> {{value}}<commit_after>class Role < ActiveRecord::Base
  belongs_to :person
  belongs_to :client

  validates_presence_of :title, :client_id, :person_id

  ADMINISTRATOR = "administrator"
  MODERATOR = "moderator"
  USER = "user"

  validates_inclusion_of :title, :in => [ADMINISTRATOR, MODERATOR, USER], 
  :message => "Role title {{value}} is not valid."
  
  def self.find_by_user_and_client_id(user_id, client_id)
    Role.find(:all, :conditions => { :person_id => user_id, :client_id => client_id })
  end
  
  def self.find_by_client_id(client_id)
    Role.find(:all, :conditions => "client_id = '#{client_id}'")
  end
  
  def self.find_by_user_id(user_id)
    Role.find(:all, :conditions => "person_id = '#{user_id}'")
  end

{'fraction_non_alphanumeric': 0.13394018205461639, 'fraction_numerical': 0.0, 'mean_word_length': 4.199324324324325, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3902917', 'n_tokens_mistral': 584, 'n_tokens_neox': 574, 'n_words': 112}