diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-03 12:54:10 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-03 13:27:00 +0100 |
commit | 573921cb9d0b139dec324fb1368feb1347b51624 (patch) | |
tree | 048c3f8a4c05127a0fc1be1de6ad60b6165bcb32 /app/serializers/deployment_entity.rb | |
parent | f1e9c97d64b96bdd398616743ad048f8d147e26b (diff) | |
download | gitlab-ce-573921cb9d0b139dec324fb1368feb1347b51624.tar.gz |
Implement entities needed for environments folders
Diffstat (limited to 'app/serializers/deployment_entity.rb')
-rw-r--r-- | app/serializers/deployment_entity.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/serializers/deployment_entity.rb b/app/serializers/deployment_entity.rb new file mode 100644 index 00000000000..3462b188337 --- /dev/null +++ b/app/serializers/deployment_entity.rb @@ -0,0 +1,27 @@ +class DeploymentEntity < Grape::Entity + include RequestAwareEntity + + expose :id + expose :iid + expose :sha + + expose :ref do + expose :name do |deployment| + deployment.ref + end + + expose :ref_url do |deployment| + @urls.namespace_project_tree_url( + deployment.project.namespace, + deployment.project, + id: deployment.ref) + end + end + + expose :tag + expose :last? + expose :user, using: API::Entities::UserBasic + expose :commit, using: CommitEntity + expose :deployable, using: BuildEntity + expose :manual_actions +end |