<commit_before>class MultiTenantBase < ActiveRecord::Base
  self.abstract_class = true
  validates :group_id, presence: true
  
  before_save :before_save
  after_create :init

  def init
    puts 'Executed init'
    @user = nil
    @group_id = nil
  end

  def before_save
    puts 'Executed before save'
    set_group_and_user
  end

  def self.current
    return Thread.current['current_group']
  end<commit_msg>DE5 - group_id set to nil after initialization<commit_after>class MultiTenantBase < ActiveRecord::Base
  self.abstract_class = true
  validates :group_id, presence: true
  
  before_save :before_save

  after_initialize :init

  def init
    self.group_id = set_group if self.group_id.nil?
    @user = set_user
  end

  def before_save
    set_group_and_user
  end

  def self.current
    return Thread.current['current_group']
  end
{'fraction_non_alphanumeric': 0.06367924528301887, 'fraction_numerical': 0.0011792452830188679, 'mean_word_length': 3.614130434782609, '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': '6177556', 'n_tokens_mistral': 281, 'n_tokens_neox': 275, 'n_words': 72}