diff options
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/current_board_entity.rb | 6 | ||||
-rw-r--r-- | app/serializers/current_board_serializer.rb | 5 | ||||
-rw-r--r-- | app/serializers/environment_status_entity.rb | 6 |
3 files changed, 14 insertions, 3 deletions
diff --git a/app/serializers/current_board_entity.rb b/app/serializers/current_board_entity.rb new file mode 100644 index 00000000000..371151532f8 --- /dev/null +++ b/app/serializers/current_board_entity.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +class CurrentBoardEntity < Grape::Entity + expose :id + expose :name +end diff --git a/app/serializers/current_board_serializer.rb b/app/serializers/current_board_serializer.rb new file mode 100644 index 00000000000..c58c77194f2 --- /dev/null +++ b/app/serializers/current_board_serializer.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class CurrentBoardSerializer < BaseSerializer + entity CurrentBoardEntity +end diff --git a/app/serializers/environment_status_entity.rb b/app/serializers/environment_status_entity.rb index f6321b9e520..811cc2ad5af 100644 --- a/app/serializers/environment_status_entity.rb +++ b/app/serializers/environment_status_entity.rb @@ -11,7 +11,7 @@ class EnvironmentStatusEntity < Grape::Entity project_environment_path(es.project, es.environment) end - expose :metrics_url, if: ->(*) { can_read_environment? && deployment.has_metrics? } do |es| + expose :metrics_url, if: ->(*) { can_read_environment? && has_metrics? } do |es| metrics_project_environment_deployment_path(es.project, es.environment, es.deployment) end @@ -45,8 +45,8 @@ class EnvironmentStatusEntity < Grape::Entity object.environment end - def deployment - object.deployment + def has_metrics? + object.has_metrics? end def project |