summaryrefslogtreecommitdiff
path: root/app/services/tartiflette_score_export_service.rb
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2024-12-29 15:14:43 +0100
committerMarius Peter <marius.peter@tutanota.com>2024-12-29 15:14:43 +0100
commitbe2a93525069de2dfa3c23b0c23e7a9f7ad4c03d (patch)
treeb5493e9d35d024ce7be072ec2168b4a98ba0e63f /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.rb19
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
Copyright 2019--2025 Marius PETER