<commit_before>class PullRequest < ActiveRecord::Base
  validates :number, numericality: true, presence: true
  validates :status, presence: true

  serialize :pending_reviews, JSON
  serialize :completed_reviews, JSON

  before_save :default_pending_and_completed_reviews

  scope :pending_review, -> { where(status: "pending_review") }

  private

  def default_pending_and_completed_reviews
    if self.pending_reviews.nil?
      self.pending_reviews = []
    end

    if self.completed_reviews.nil?
      self.completed_reviews = []
    end
  end
end
<commit_msg>default serailized columns after initialize instead of before save<commit_after>class PullRequest < ActiveRecord::Base
  validates :number, numericality: true, presence: true
  validates :status, presence: true

  serialize :pending_reviews, JSON
  serialize :completed_reviews, JSON

  after_initialize :default_pending_and_completed_reviews

  scope :pending_review, -> { where(status: "pending_review") }

  private

  def default_pending_and_completed_reviews
    if self.pending_reviews.nil?
      self.pending_reviews = []
    end

    if self.completed_reviews.nil?
      self.completed_reviews = []
    end
  end
end

{'fraction_non_alphanumeric': 0.0738255033557047, 'fraction_numerical': 0.0, 'mean_word_length': 4.447488584474886, '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': '7118620', 'n_tokens_mistral': 375, 'n_tokens_neox': 348, 'n_words': 84}