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: application_helper.rb
    path of file: ./repos/chordbook/app/helpers
    
    the code of the file until where you have to start completion: module ApplicationHelper
  def variant_url(attachment, variant_name)
    return unles
    
  def variant_url(attachment, variant_name)
    return unless attachment&.variable?

    variant = attachment.variant(variant_name)
    if variant.processed? && variant.service.public?
      # Variant is processed and public, link directly to it.
      variant.url
    else
      # Variant needs processed or is not public, so let ActiveStorage do its thing
      rails_blob_url(variant)
    end
  end