<commit_before>class User < ActiveRecord::Base
  # Include default devise modules.
  # :lockable, :timeoutable
  devise :database_authenticatable, :registerable,
          :recoverable, :rememberable, :trackable, :validatable,
          :omniauthable
  include DeviseTokenAuth::Concerns::User

  has_one :character
  has_many :purchases
  has_many :elite_items, :through => :purchases
  after_commit :create_character

  def create_character
    Character.create!(user: self)
  end<commit_msg>Fix Character model so that character is only created when a user is created<commit_after>class User < ActiveRecord::Base
  # Include default devise modules.
  # :lockable, :timeoutable
  devise :database_authenticatable, :registerable,
          :recoverable, :rememberable, :trackable, :validatable,
          :omniauthable
  include DeviseTokenAuth::Concerns::User

  has_one :character
  has_many :purchases
  has_many :elite_items, :through => :purchases
  after_commit :create_character, on: :create

  def create_character
    Character.create!(user: self)
  end
{'fraction_non_alphanumeric': 0.08380414312617702, 'fraction_numerical': 0.0, 'mean_word_length': 4.71505376344086, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7216665', 'n_tokens_mistral': 329, 'n_tokens_neox': 312, 'n_words': 82}