#full_data_strings_array -> #export_values

This commit is contained in:
Paul Chavard 2018-04-26 18:25:59 +02:00 committed by gregoirenovel
parent 8637a3015e
commit 0b7cf3ae75
3 changed files with 8 additions and 8 deletions

View file

@ -138,12 +138,6 @@ class Dossier < ApplicationRecord
end
end
def full_data_strings_array
to_sorted_values.map do |value|
serialize_value_for_export(value)
end
end
def export_etablissement_data
if etablissement.present?
etablissement_attr = EtablissementCsvSerializer.new(self.etablissement).attributes.transform_keys { |k| "etablissement.#{k}".parameterize.underscore.to_sym }
@ -173,6 +167,12 @@ class Dossier < ApplicationRecord
headers
end
def export_values
to_sorted_values.map do |value|
serialize_value_for_export(value)
end
end
def followers_gestionnaires
follows.includes(:gestionnaire).map(&:gestionnaire)
end

View file

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

View file

@ -319,7 +319,7 @@ describe Dossier do
subject { dossier }
it { expect(dossier.full_data_strings_array).to eq(expected_string) }
it { expect(dossier.export_values).to eq(expected_string) }
end
end