<commit_before>require 'bcrypt'

class User < ActiveRecord::Base
  has_many :folios
  has_many :elements, through: :folios

  validates :first_name, presence: true, unless: :provider
  validates :first_name, presence: true, unless: :provider


  validates :email, uniqueness: true,
                    presence: true,
                    format: { with: /\w+@\w+\.\w{2,3}/i, message: "please enter a valid email address"},
                    unless: :provider


  # validates :password, presence: true, unless: :provider
  has_secure_password(validations: false)

  def self.from_omniauth(auth)
    where(auth.slice(:provider, :uid)).first_or_initialize.tap do |user|
      user.provider = auth.provider
      user.uid = auth.uid
      user.email = auth.info.email
      user.oauth_token = auth.credentials.token
      # user.oauth_expires_at = Time.at(auth.credentials.expires_at)
      user.save!
    end
  end


end<commit_msg>Put back error line in user model<commit_after>require 'bcrypt'

class User < ActiveRecord::Base
  has_many :folios
  has_many :elements, through: :folios

  validates :first_name, presence: true, unless: :provider
  validates :first_name, presence: true, unless: :provider


  validates :email, uniqueness: true,
                    presence: true,
                    format: { with: /\w+@\w+\.\w{2,3}/i, message: "please enter a valid email address"},
                    unless: :provider


  # validates :password, presence: true, unless: :provider
  has_secure_password(validations: false)

  def self.from_omniauth(auth)
    where(auth.slice(:provider, :uid)).first_or_initialize.tap do |user|
      user.provider = auth.provider
      user.uid = auth.uid
      user.email = auth.info.email
      user.oauth_token = auth.credentials.token
      user.oauth_expires_at = Time.at(auth.credentials.expires_at)
      user.save!
    end
  end


end
{'fraction_non_alphanumeric': 0.11010638297872341, 'fraction_numerical': 0.002127659574468085, 'mean_word_length': 2.9683544303797467, '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': '2083814', 'n_tokens_mistral': 604, 'n_tokens_neox': 575, 'n_words': 143}