<commit_before>class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable, :omniauthable,
         :recoverable, :rememberable, :trackable, :validatable

 validates :top_3_interests, length: {maximum: 3, too_long: " is limited to %{count} interests"}
 after_validation :check_industry

  def self.connect_to_linkedin(auth, signed_in_resource =nil)
    user = User.where(:provider => auth.provider, :uid => auth.uid).first
    if user
      return user
    else
      registered_user = User.where(:email => auth.info.email).first
      if registered_user
        return registered_user
      else
        p user = User.create(first_name:auth.info.first_name, last_name:auth.info.last_name, provider:auth.provider, uid:auth.uid, email:auth.info.email, password:Devise.friendly_token[0,20] )
      end
    end
  end

  def check_industry
    if self.primary_industry == "Other" || self.primary_industry == nil
      self.waitlist = true
    else<commit_msg>adding validation for the presence of first_name<commit_after>class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable, :omniauthable,
         :recoverable, :rememberable, :trackable, :validatable

 validates :top_3_interests, length: {maximum: 3, too_long: " is limited to %{count} interests"}
 validates_presence_of :first_name
 after_validation :check_industry

  def self.connect_to_linkedin(auth, signed_in_resource =nil)
    user = User.where(:provider => auth.provider, :uid => auth.uid).first
    if user
      return user
    else
      registered_user = User.where(:email => auth.info.email).first
      if registered_user
        return registered_user
      else
        p user = User.create(first_name:auth.info.first_name, last_name:auth.info.last_name, provider:auth.provider, uid:auth.uid, email:auth.info.email, password:<PASSWORD>.friendly_token[0,20] )
      end
    end
  end

  def check_industry
    if self.primary_industry == "Other" || self.primary_industry == nil
      self.waitlist = true
    else
{'fraction_non_alphanumeric': 0.09938162544169611, 'fraction_numerical': 0.00441696113074205, 'mean_word_length': 4.07847533632287, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 10, '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': '2083831', 'n_tokens_mistral': 704, 'n_tokens_neox': 677, 'n_words': 165}