<commit_before>class InvoiceAddonLineItem < ActiveRecord::Base
  belongs_to :invoice
  belongs_to :package_addon_type

  validates_presence_of :invoice
  validates_presence_of :package_addon_type
  validates_uniqueness_of :package_addon_type, scope: :invoice

  def price
    quantity * package_addon_type.price
  end
end<commit_msg>Fix validations on invoice line items<commit_after>class InvoiceAddonLineItem < ActiveRecord::Base
  belongs_to :invoice
  belongs_to :package_addon_type

  validates_presence_of :invoice, :package_addon_type, :quantity

  validates_uniqueness_of :package_addon_type, scope: :invoice
  validates_numericality_of :quantity, greater_than: 0

  def price
    quantity * package_addon_type.price
  end
end
{'fraction_non_alphanumeric': 0.051771117166212535, 'fraction_numerical': 0.0013623978201634877, 'mean_word_length': 6.577319587628866, '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': '7042430', 'n_tokens_mistral': 253, 'n_tokens_neox': 245, 'n_words': 50}