<commit_before>class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable,
  # :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable,
         :authentication_keys => [ :name ]
#         :openid_authenticatable #Don't feel like dealing with this

  before_create :de_guest
  after_create :welcome_mail

  has_many :posts, dependent: :nullify
  has_one :ban, dependent: :nullify
  has_and_belongs_to_many :watched_posts, -> { uniq }, :class_name => 'Post'

  validates :name, :presence => true
  validates :name, :uniqueness => true
  validates_length_of :name, :maximum => 80
  validate :check_email_ban

  def email_changed?
    false
  end

  private
  def de_guest
    self.guest_user = false
    true
  end

  def welcome_mail
    BoardMailer.welcome_email(self).deliver_now<commit_msg>Change deletion policy for users<commit_after>class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable,
  # :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable,
         :authentication_keys => [ :name ]
#         :openid_authenticatable #Don't feel like dealing with this

  before_create :de_guest
  after_create :welcome_mail

  has_many :posts, dependent: :restrict_with_exception
  has_one :ban, dependent: :nullify
  has_and_belongs_to_many :watched_posts, -> { uniq }, :class_name => 'Post'

  validates :name, :presence => true
  validates :name, :uniqueness => true
  validates_length_of :name, :maximum => 80
  validate :check_email_ban

  def email_changed?
    false
  end

  private
  def de_guest
    self.guest_user = false
    true
  end

  def welcome_mail
    BoardMailer.welcome_email(self).deliver_now
{'fraction_non_alphanumeric': 0.08762098828323994, 'fraction_numerical': 0.0020376974019358125, 'mean_word_length': 4.293800539083558, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '2311556', 'n_tokens_mistral': 654, 'n_tokens_neox': 618, 'n_words': 157}