<commit_before>class User < ApplicationRecord
  validates :email, presence: true

  has_secure_password
  has_many :sessions, dependent: :destroy

  def self.from_omniauth(data={})
    User.where(provider: data[:provider], uid: data[:uid]).first_or_create do |user|
      user.password = data[:info][:password]
      user.email = data[:info][:email]
      user.name = data[:info][:name]
      user.username = data[:info][:username]
      user.last_name = data[:info][:last_name]
    end
  end
end<commit_msg>Add validations for user model<commit_after>class User < ApplicationRecord
  validates :email, presence: true

  has_secure_password
  has_many :sessions, dependent: :destroy

  def self.from_omniauth(data={})
    User.where(provider: data[:info][:email]).first_or_create do |user|
      user.password = <PASSWORD>]
      user.email = data[:info][:email]
      user.name = data[:info][:name]
      user.username = data[:info][:username]
      user.last_name = data[:info][:last_name]
    end
  end
end
{'fraction_non_alphanumeric': 0.1377601585728444, 'fraction_numerical': 0.0, 'mean_word_length': 4.17948717948718, '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': '2531420', 'n_tokens_mistral': 327, 'n_tokens_neox': 319, 'n_words': 67}