diff options
author | Douwe Maan <douwe@gitlab.com> | 2019-04-19 12:04:25 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-04-19 12:04:25 +0300 |
commit | 6376f78445300ee42c5a181f63e5b332d8266b0a (patch) | |
tree | 1d5716ab2080458920b39cadacc1926cd3db52c1 /app/models/namespace.rb | |
parent | 604cfb17a79b203dca7a2c56e84b58f8e819effd (diff) | |
parent | 1dd4a007804fa0e6ea00a00805d08808f6c0be3a (diff) |
Merge branch '39858-add-group-owned-info-to-projects-api' into 'master'
Return group information on Project endpoint
Closes #39858
See merge request gitlab-org/gitlab-ce!27427
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 5 |
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 |