<commit_before>class MigrationRun < ActiveRecord::Base

  enum status: [ :created, :preparing, :running, :completed_success, :completed_error, :canceled, :unknown, :queued, :aborted, :failed ]
  enum phase: [:test_only, :create_shell]
  before_save :update_max_records

  belongs_to :user
  belongs_to :source_system, class_name: 'System'
  belongs_to :destination_system, class_name: 'System'
  has_many :migration_logs

  validates_presence_of :source_system
  validates_presence_of :destination_system
  validates_presence_of :entity_type
  validates_presence_of :phase


  def update_max_records
    if all_records
      self[:max_records] = -1 if self[:max_records].nil?
    else
      self[:max_records] = record_list.split("\r\n").count<commit_msg>changed my mind - need to keep history phase<commit_after>class MigrationRun < ActiveRecord::Base

  enum status: [ :created, :preparing, :running, :completed_success, :completed_error, :canceled, :unknown, :queued, :aborted, :failed ]
  enum phase: [:test_only, :create_shell, :add_history]
  before_save :update_max_records

  belongs_to :user
  belongs_to :source_system, class_name: 'System'
  belongs_to :destination_system, class_name: 'System'
  has_many :migration_logs

  validates_presence_of :source_system
  validates_presence_of :destination_system
  validates_presence_of :entity_type
  validates_presence_of :phase


  def update_max_records
    if all_records
      self[:max_records] = -1 if self[:max_records].nil?
    else
      self[:max_records] = record_list.split("\r\n").count
{'fraction_non_alphanumeric': 0.09581993569131833, 'fraction_numerical': 0.0012861736334405145, 'mean_word_length': 5.6781115879828326, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '785792', 'n_tokens_mistral': 522, 'n_tokens_neox': 511, 'n_words': 111}