You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tax_category.rb
    path of file: ./repos/openfoodnetwork/app/models/spree
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Spree
  class TaxCategory < ApplicationRecord
    acts_as_paranoid
    validates :name, presence: true, uniqueness: { scope: :deleted_at }

    has_many :tax_rates, dep
    
    def set_default_category
      # set existing default tax category to false if this one has been marked as default

      return unless is_default && tax_category = self.class.find_by(is_default: true)
      return if tax_category == self

      tax_category.update_columns(
        is_default: false,
        updated_at: Time.zone.now
      )
    end