Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2019-04-16 19:16:52 +0300
committerMayra Cabrera <mcabrera@gitlab.com>2019-04-19 03:00:48 +0300
commit1dd4a007804fa0e6ea00a00805d08808f6c0be3a (patch)
tree09a6b2520dfea63090b3375f02f36724639951e2 /app
parent86be4a6f466205b415de74330dd495a2e8b3c9d0 (diff)
Adds namespace information to project endpoint
- Namespace now return avatar_url and web_url - NamespaceBasic entity was modified to include avatar_url and web_url, information is fetched differently depending if the Namespace is a user or a group Includes documentation changes Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/39858
Diffstat (limited to 'app')
-rw-r--r--app/models/namespace.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index dea34e812ca..8638c5a9c53 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -51,6 +51,7 @@ class Namespace < ApplicationRecord
validate :nesting_level_allowed
delegate :name, to: :owner, allow_nil: true, prefix: true
+ delegate :avatar_url, to: :owner, allow_nil: true
after_commit :refresh_access_of_projects_invited_groups, on: :update, if: -> { previous_changes.key?('share_with_group_lock') }
@@ -149,6 +150,10 @@ class Namespace < ApplicationRecord
type == 'Group' ? 'group' : 'user'
end
+ def user?
+ kind == 'user'
+ end
+
def find_fork_of(project)
return unless project.fork_network