fix: url helper method calls for files

This commit is contained in:
Nicolas Cavigneaux 2023-03-13 09:48:11 +01:00 committed by Colin Darie
parent f78b415c51
commit 3aa6a5e28e
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
8 changed files with 8 additions and 8 deletions

View file

@ -11,7 +11,7 @@
- elsif export.available?
- menu.with_item do
%div
= link_to ready_link_label(export), export.file.service_url, target: "_blank", rel: "noopener", role: 'menuitem'
= link_to ready_link_label(export), export.file.url, target: "_blank", rel: "noopener", role: 'menuitem'
- if export.old?
= button_to download_export_path(export_format: export.format, force_export: true), refresh_button_options(export).merge(role: 'menuitem') do
.icon.retry

View file

@ -15,7 +15,7 @@ module Administrateurs
end
format.html do
redirect_to export.file.service_url
redirect_to export.file.url
end
end
else

View file

@ -19,7 +19,7 @@ module Instructeurs
def attestation
if dossier.attestation.pdf.attached?
redirect_to dossier.attestation.pdf.service_url
redirect_to dossier.attestation.pdf.url
end
end

View file

@ -175,7 +175,7 @@ module Instructeurs
end
format.html do
redirect_to export.file.service_url
redirect_to export.file.url
end
end
else

View file

@ -73,7 +73,7 @@ module Users
def attestation
if dossier.attestation&.pdf&.attached?
redirect_to dossier.attestation.pdf.service_url
redirect_to dossier.attestation.pdf.url
else
flash.notice = t('.no_longer_available')
redirect_to dossier_path(dossier)

View file

@ -11,7 +11,7 @@ module Types
if object.is_a?(Hash)
object[:url]
else
object.service_url
object.url
end
end
end

View file

@ -55,7 +55,7 @@ class Champs::PieceJustificativeChamp < Champ
return nil if attachment.nil?
if attachment.virus_scanner.safe? || attachment.virus_scanner.pending?
attachment.service_url
attachment.url
end
end
end

View file

@ -86,7 +86,7 @@ class Export < ApplicationRecord
def flash_message
if available?
"Lexport au format \"#{format}\" est prêt. Vous pouvez le <a href=\"#{file.service_url}\">télécharger</a>"
"Lexport au format \"#{format}\" est prêt. Vous pouvez le <a href=\"#{file.url}\">télécharger</a>"
else
"Nous générons cet export. Veuillez revenir dans quelques minutes pour le télécharger."
end