remove procedure_presentation from export
This commit is contained in:
parent
71bcbbc440
commit
f850924dc0
3 changed files with 9 additions and 6 deletions
|
@ -30,7 +30,7 @@ class Dossiers::ExportLinkComponent < ApplicationComponent
|
|||
end
|
||||
|
||||
def export_title(export)
|
||||
if export.procedure_presentation_id.nil?
|
||||
if !export.built_from_procedure_presentation?
|
||||
t(".export_title_everything", export_format: export.format)
|
||||
elsif export.tous?
|
||||
t(".export_title", export_format: export.format, count: export.count)
|
||||
|
|
|
@ -94,7 +94,6 @@ class Export < ApplicationRecord
|
|||
|
||||
create!(**attributes, groupe_instructeurs:,
|
||||
user_profile:,
|
||||
procedure_presentation:,
|
||||
filtered_columns:,
|
||||
sorted_column:)
|
||||
end
|
||||
|
@ -118,7 +117,7 @@ class Export < ApplicationRecord
|
|||
|
||||
def count
|
||||
return dossiers_count if !dossiers_count.nil? # export generated
|
||||
return dossiers_for_export.count if procedure_presentation_id.present?
|
||||
return dossiers_for_export.count if built_from_procedure_presentation?
|
||||
|
||||
nil
|
||||
end
|
||||
|
@ -127,6 +126,10 @@ class Export < ApplicationRecord
|
|||
groupe_instructeurs.first.procedure
|
||||
end
|
||||
|
||||
def built_from_procedure_presentation?
|
||||
sorted_column.present? # hack has we know that procedure_presentation always has a sorted_column
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def dossiers_for_export
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue