<commit_before>Spree::Order.class_eval do
  register_update_hook :generate_digital_links

  # all products are digital
  def digital?
    line_items.all? { |item| item.digital? }
  end
  
  def some_digital?
    line_items.any? { |item| item.digital? }
  end

  def digital_line_items
    line_items.select(&:digital?)
  end

  def digital_links
    digital_line_items.map(&:digital_links).flatten
  end

  def reset_digital_links!<commit_msg>Adds new method in Spree::Order not_digital<commit_after>Spree::Order.class_eval do
  register_update_hook :generate_digital_links

  # all products are digital
  def digital?
    line_items.all? { |item| item.digital? }
  end
  
  def some_digital?
    line_items.any? { |item| item.digital? }
  end

  def some_not_digital?
    line_items.any? { |item| !item.digital? }
  end

  def digital_line_items
    line_items.select(&:digital?)
  end

  def digital_links
    digital_line_items.map(&:digital_links).flatten
  end

  def reset_digital_links!
{'fraction_non_alphanumeric': 0.09063444108761329, 'fraction_numerical': 0.0, 'mean_word_length': 3.9949748743718594, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2745523', 'n_tokens_mistral': 364, 'n_tokens_neox': 337, 'n_words': 70}