Simplify Procedure#generate_export code

This commit is contained in:
Paul Chavard 2018-04-26 16:59:16 +02:00 committed by gregoirenovel
parent 031522cf42
commit 8637a3015e

View file

@ -189,7 +189,7 @@ class Procedure < ApplicationRecord
def generate_export
exportable_dossiers = dossiers.downloadable_sorted
headers = exportable_dossiers.any? ? exportable_dossiers.first.export_headers : []
headers = exportable_dossiers&.first&.export_headers || []
data = exportable_dossiers.any? ? exportable_dossiers.map { |d| d.full_data_strings_array } : [[]]
{