diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-28 15:32:07 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-02 16:26:57 +0300 |
commit | acfe394018df50bfc08aa9e41265231747675646 (patch) | |
tree | 776b34a9f27c149d8863775f760036b2484ed866 /app/serializers/environment_entity.rb | |
parent | 2023511753d75545aa76968a2991dc962f7a99db (diff) |
Add PoC for resource serializers
Diffstat (limited to 'app/serializers/environment_entity.rb')
-rw-r--r-- | app/serializers/environment_entity.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/serializers/environment_entity.rb b/app/serializers/environment_entity.rb new file mode 100644 index 00000000000..9415f1dd450 --- /dev/null +++ b/app/serializers/environment_entity.rb @@ -0,0 +1,17 @@ +class EnvironmentEntity < Grape::Entity + include RequestAwareEntity + include Gitlab::Routing.url_helpers + + expose :id + expose :name + expose :project, with: ProjectEntity + expose :last_deployment, + as: :deployment, + using: API::Entities::Deployment + + expose :environment_path + + def environment_path + request.path + end +end |