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

    include Cdx::Admin::ResourceRecord

    def content_header_title
      email
    end

    store_accessor :settings, :theme

    def gravatar_url
      "https://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.downcase)}"
    end

  end
end<commit_msg>Add validators<commit_after>module Cdx
  class User < ApplicationRecord
    # Include default devise modules. Others available are:
    # :confirmable, :lockable, :timeoutable and :omniauthable
    devise :database_authenticatable, :registerable,
           :recoverable, :rememberable, :trackable, :validatable

    include Cdx::Admin::ResourceRecord

    store_accessor :settings, :theme

    # Validators

    validates :email, :first_name, :last_name, presence: true

    # Methods

    def content_header_title
      email
    end

    def gravatar_url
      "https://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.downcase)}"
    end

    def full_name
      "#{first_name} #{last_name}".strip
    end
  end
end
{'fraction_non_alphanumeric': 0.09190031152647975, 'fraction_numerical': 0.001557632398753894, 'mean_word_length': 3.5406360424028267, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '2093317', 'n_tokens_mistral': 406, 'n_tokens_neox': 380, 'n_words': 91}