diff options
author | Marius Peter <marius.peter@tutanota.com> | 2024-12-29 15:14:43 +0100 |
---|---|---|
committer | Marius Peter <marius.peter@tutanota.com> | 2024-12-29 15:14:43 +0100 |
commit | be2a93525069de2dfa3c23b0c23e7a9f7ad4c03d (patch) | |
tree | b5493e9d35d024ce7be072ec2168b4a98ba0e63f /app/services/tartiflette_score_export_service.rb |
First commit.
Diffstat (limited to 'app/services/tartiflette_score_export_service.rb')
-rw-r--r-- | app/services/tartiflette_score_export_service.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/services/tartiflette_score_export_service.rb b/app/services/tartiflette_score_export_service.rb new file mode 100644 index 0000000..26334a0 --- /dev/null +++ b/app/services/tartiflette_score_export_service.rb @@ -0,0 +1,19 @@ +require "csv" + +class TartifletteScoreExportService + def self.generate_csv + CSV.generate(headers: true) do |csv| + csv << [ "Identifiant", "Critère", "Score", "Création" ] + Tartiflette.all.each do |tartiflette| + tartiflette.scores.each do |score| + csv << [ + tartiflette.scoring_id, + score.scoring_criterium.name, + score.value, + score.created_at + ] + end + end + end + end +end |