module Attachable

def attached_url(attachment_type)

def attached_url(attachment_type)
  if send(attachment_type.to_s).attached? && send(attachment_type.to_s).class == ActiveStorage::Attached::One
    Rails.application.routes.url_helpers.rails_blob_url(send(attachment_type.to_s))
  elsif send(attachment_type.to_s).attached? && send(attachment_type.to_s).class == ActiveStorage::Attached::Many
    send(attachment_type.to_s)
  end
end