summaryrefslogtreecommitdiff
path: root/app/serializers/ci/daily_build_group_report_result_entity.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/ci/daily_build_group_report_result_entity.rb')
-rw-r--r--app/serializers/ci/daily_build_group_report_result_entity.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/serializers/ci/daily_build_group_report_result_entity.rb b/app/serializers/ci/daily_build_group_report_result_entity.rb
new file mode 100644
index 00000000000..e4118db9b1f
--- /dev/null
+++ b/app/serializers/ci/daily_build_group_report_result_entity.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module Ci
+ class DailyBuildGroupReportResultEntity < Grape::Entity
+ expose :date
+
+ ::Ci::DailyBuildGroupReportResult::PARAM_TYPES.each do |type|
+ expose type, if: lambda { |report_result, options| options[:param_type] == type } do |report_result, options|
+ report_result.data[options[:param_type]]
+ end
+ end
+ end
+end