Read from path attribute instead of procedure_path when possible

This commit is contained in:
Paul Chavard 2018-09-13 18:33:35 +02:00
parent 2787f040af
commit b772256a97
2 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
module ProcedureHelper
def procedure_lien(procedure)
if procedure.procedure_path.present?
if procedure.path.present?
if procedure.brouillon_avec_lien?
commencer_test_url(procedure_path: procedure.path)
else

View file

@ -131,7 +131,7 @@ class Procedure < ApplicationRecord
# This method is needed for transition. Eventually this will be the same as brouillon?.
def brouillon_avec_lien?
Flipflop.publish_draft? && brouillon? && procedure_path.present?
Flipflop.publish_draft? && brouillon? && path.present?
end
def publiee_ou_archivee?
@ -250,7 +250,7 @@ class Procedure < ApplicationRecord
end
def export_filename
procedure_identifier = procedure_path&.path || "procedure-#{id}"
procedure_identifier = path || "procedure-#{id}"
"dossiers_#{procedure_identifier}_#{Time.now.strftime('%Y-%m-%d_%H-%M')}"
end