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

  has_many :mentors, class_name: "Mentor", foreign_key: "mentor_id"
  has_many :mentees, class_name: "Mentor", foreign_key: "mentee_id"
  has_many :peer1, class_name: "Peer", foreign_key: "peer1_id"
  has_many :peer2, class_name: "Peer", foreign_key: "peer2_id"
  has_many :peer3, class_name: "Peer", foreign_key: "peer3_id"
  has_many :peer4, class_name: "Peer", foreign_key: "peer4_id"
 validates :top_3_interests, length: {maximum: 3, too_long: " is limited to %{count} interests"}
 validates_presence_of :first_name, :last_name
 validates_presence_of :mentor_industry, if: :mentor
 after_validation :check_industry

 after_save :send_mail

  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
        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 self.update_month
    User.all.each do |user|
      user.update(mentor_times: user.mentor_limit,is_participating_this_month: user.is_participating_next_month, is_participating_next_month: false, is_assigned_peer_group: false)
    end
    Peer.automattially_create_groups
  end

  def send_mail
    UserMailer.welcome_mail(user).deliver
  end

  def check_industry
    if self.primary_industry == "Other" || self.primary_industry == nil || self.peer_industry == nil || self.top_3_interests == [] || self.current_goal == nil
      self.waitlist = true
    else
      self.waitlist = false
    end
  end

end<commit_msg>another try but this time I think it will work<commit_after>class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :omniauthable
         # :recoverable, :rememberable, :trackable, :validatable,  :registerable

  has_many :mentors, class_name: "Mentor", foreign_key: "mentor_id"
  has_many :mentees, class_name: "Mentor", foreign_key: "mentee_id"
  has_many :peer1, class_name: "Peer", foreign_key: "peer1_id"
  has_many :peer2, class_name: "Peer", foreign_key: "peer2_id"
  has_many :peer3, class_name: "Peer", foreign_key: "peer3_id"
  has_many :peer4, class_name: "Peer", foreign_key: "peer4_id"
 validates :top_3_interests, length: {maximum: 3, too_long: " is limited to %{count} interests"}
 validates_presence_of :first_name, :last_name
 validates_presence_of :mentor_industry, if: :mentor
 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
        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] )
        UserMailer.welcome_mail(user).deliver
        user
      end
    end
  end

  def self.update_month
    User.all.each do |user|
      user.update(mentor_times: user.mentor_limit,is_participating_this_month: user.is_participating_next_month, is_participating_next_month: false, is_assigned_peer_group: false)
    end
    Peer.automattially_create_groups
  end

  def check_industry
    if self.primary_industry == "Other" || self.primary_industry == nil || self.peer_industry == nil || self.top_3_interests == [] || self.current_goal == nil
      self.waitlist = true
    else
      self.waitlist = false
    end
  end

end
{'fraction_non_alphanumeric': 0.10245999522331024, 'fraction_numerical': 0.006687365655600669, 'mean_word_length': 4.503285151116952, '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': '186842', 'n_tokens_mistral': 1434, 'n_tokens_neox': 1392, 'n_words': 308}