<commit_before>class User < ActiveRecord::Base
  # Remember to create a migration!
  validates :email, uniqueness: true

  has_many :tweets
end
<commit_msg>added password encryption in user controller<commit_after>class User < ActiveRecord::Base
  # Remember to create a migration!
  validates :email, uniqueness: true

  has_many :tweets

  before_save do
    encrypt_password
  end

  def encrypt_password
    self.password = <PASSWORD>(password)
  end

  def self.authenticate(email, password)
    if user = User.find_by(email: email)
      return user if SCrypt::Password.new(user.password) == password
    else raise "Incorrect email or password or password and email or something"
    end
  end

end

{'fraction_non_alphanumeric': 0.06940509915014165, 'fraction_numerical': 0.0, 'mean_word_length': 4.086330935251799, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, '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': '5729039', 'n_tokens_mistral': 212, 'n_tokens_neox': 202, 'n_words': 70}