<commit_before>class ReleaseSnapshot < ActiveRecord::Base
  belongs_to :project
  belongs_to :release
  belongs_to :sprint

  class << self
    def generate(release)
      project = release.project
      features = release.features

      sprint = project.current_sprint

      if sprint.empty?
        sprint = project.latest_sprint
      end

      unless sprint.empty?
        features = features.where(['sprint_id = ?',sprint])
      end
<commit_msg>Check on nil now<commit_after>class ReleaseSnapshot < ActiveRecord::Base
  belongs_to :project
  belongs_to :release
  belongs_to :sprint

  class << self
    def generate(release)
      project = release.project
      features = release.features

      sprint = project.current_sprint

      if sprint.nil?
        sprint = project.latest_sprint
      end

      unless sprint.nil?
        features = features.where(['sprint_id = ?',sprint])
      end

{'fraction_non_alphanumeric': 0.07938257993384785, 'fraction_numerical': 0.0, 'mean_word_length': 2.7520661157024793, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4901858', 'n_tokens_mistral': 258, 'n_tokens_neox': 259, 'n_words': 63}