<commit_before>module Spree
  class TaxRate < Spree::Base
    acts_as_paranoid

    include Spree::CalculatedAdjustments
    include Spree::AdjustmentSource

    belongs_to :zone, class_name: "Spree::Zone", inverse_of: :tax_rates
    belongs_to :tax_category,
               class_name: "Spree::TaxCategory",
               inverse_of: :tax_rates

    validates :amount, presence: true, numericality: true
    validates :tax_category_id, presence: true

    scope :by_zone, -> (zone) { where(zone_id: zone.id) }<commit_msg>Add allow nil to numericality validation with presence in spree tax_rate<commit_after>module Spree
  class TaxRate < Spree::Base
    acts_as_paranoid

    include Spree::CalculatedAdjustments
    include Spree::AdjustmentSource

    belongs_to :zone, class_name: "Spree::Zone", inverse_of: :tax_rates
    belongs_to :tax_category,
               class_name: "Spree::TaxCategory",
               inverse_of: :tax_rates

    validates :amount, presence: true, numericality: { allow_nil: true }
    validates :tax_category_id, presence: true

    scope :by_zone, -> (zone) { where(zone_id: zone.id) }
{'fraction_non_alphanumeric': 0.09196428571428572, 'fraction_numerical': 0.0, 'mean_word_length': 3.7905982905982905, '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': '6794225', 'n_tokens_mistral': 357, 'n_tokens_neox': 346, 'n_words': 85}