summaryrefslogtreecommitdiff
path: root/app/serializers/feature_flag_summary_entity.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/feature_flag_summary_entity.rb')
-rw-r--r--app/serializers/feature_flag_summary_entity.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/serializers/feature_flag_summary_entity.rb b/app/serializers/feature_flag_summary_entity.rb
new file mode 100644
index 00000000000..be4f02dabca
--- /dev/null
+++ b/app/serializers/feature_flag_summary_entity.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class FeatureFlagSummaryEntity < Grape::Entity
+ include RequestAwareEntity
+
+ expose :count do
+ expose :all do |project|
+ project.operations_feature_flags.count
+ end
+
+ expose :enabled do |project|
+ project.operations_feature_flags.enabled.count
+ end
+
+ expose :disabled do |project|
+ project.operations_feature_flags.disabled.count
+ end
+ end
+end