diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-09-13 11:11:09 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-04 22:49:41 +0200 |
commit | 4c8942f9b8cffe6bf513c4766e8f4260c0550b61 (patch) | |
tree | ebb6f5f71cc01e8ccf745ace395095c3651f761b /app/serializers | |
parent | 1fb49b8729b126360e9852b184c0ba63c330c4b5 (diff) | |
download | gitlab-ce-4c8942f9b8cffe6bf513c4766e8f4260c0550b61.tar.gz |
Replace `full_path`, `path` & `web_url` with a single `relative_path`
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/group_child_entity.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/serializers/group_child_entity.rb b/app/serializers/group_child_entity.rb index 1940bc07eab..35f5a020793 100644 --- a/app/serializers/group_child_entity.rb +++ b/app/serializers/group_child_entity.rb @@ -2,7 +2,7 @@ class GroupChildEntity < Grape::Entity include ActionView::Helpers::NumberHelper include RequestAwareEntity - expose :id, :name, :path, :description, :visibility, :full_name, :full_path, :web_url, + expose :id, :name, :description, :visibility, :full_name, :relative_path, :created_at, :updated_at, :can_edit, :type, :avatar_url, :permission, :edit_path def project? @@ -31,6 +31,14 @@ class GroupChildEntity < Grape::Entity end end + def relative_path + if project? + project_path(object) + else + group_path(object) + end + end + def permission return unless request&.current_user |