<commit_before>module CropsHelper
  def display_seed_availability(member, crop)
    total_quantity = 0
    member.seeds.each do |seed|
      if seed.crop.name == crop.name
        total_quantity = total_quantity + seed.quantity
      end
    end

    if (total_quantity != 0)
      "You have #{pluralize(total_quantity, "seed")} of this crop."
    else
      "You don't have any seeds of this crop."
    end
  
  end
end<commit_msg>#920 Deal with .nil quantity of a seed in rendering helper<commit_after>module CropsHelper
  def display_seed_availability(member, crop)
    total_quantity = 0
    member.seeds.each do |seed|
      if seed.crop.name == crop.name && seed.quantity
        total_quantity = total_quantity + seed.quantity
      end
    end

    if (total_quantity != 0)
      "You have #{pluralize(total_quantity, "seed")} of this crop."
    else
      "You don't have any seeds of this crop."
    end
  
  end
end
{'fraction_non_alphanumeric': 0.08747300215982722, 'fraction_numerical': 0.00755939524838013, 'mean_word_length': 2.7530364372469633, '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': '7629769', 'n_tokens_mistral': 310, 'n_tokens_neox': 284, 'n_words': 90}