summaryrefslogtreecommitdiff
path: root/app/serializers/environment_entity.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-03 12:54:10 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-03 13:27:00 +0100
commit573921cb9d0b139dec324fb1368feb1347b51624 (patch)
tree048c3f8a4c05127a0fc1be1de6ad60b6165bcb32 /app/serializers/environment_entity.rb
parentf1e9c97d64b96bdd398616743ad048f8d147e26b (diff)
downloadgitlab-ce-573921cb9d0b139dec324fb1368feb1347b51624.tar.gz
Implement entities needed for environments folders
Diffstat (limited to 'app/serializers/environment_entity.rb')
-rw-r--r--app/serializers/environment_entity.rb22
1 files changed, 9 insertions, 13 deletions
diff --git a/app/serializers/environment_entity.rb b/app/serializers/environment_entity.rb
index 006b2841e8f..6b037e65e55 100644
--- a/app/serializers/environment_entity.rb
+++ b/app/serializers/environment_entity.rb
@@ -1,25 +1,21 @@
class EnvironmentEntity < Grape::Entity
include RequestAwareEntity
- include Gitlab::Routing.url_helpers
expose :id
expose :name
+ expose :state
+ expose :external_url
+ expose :environment_type
expose :project, with: ProjectEntity
- expose :last_deployment,
- as: :deployment,
- using: API::Entities::Deployment
+ expose :last_deployment, using: DeploymentEntity
+ expose :stoppable?
- expose :gitlab_path do |environment|
- namespace_project_environment_path(
+ expose :environmenturl do |environment|
+ @urls.namespace_project_environment_url(
environment.project.namespace,
environment.project,
- environment
- )
+ environment)
end
- expose :can_read?
-
- def can_read?
- Ability.allowed?(request.user, :read_environment, @object)
- end
+ expose :created_at, :updated_at
end