summaryrefslogtreecommitdiff
path: root/app/models/namespace.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-09-26 14:49:22 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-09-26 14:49:22 +0300
commit65b9768ccfbdc3de682d66430601cf3af1b2a2f8 (patch)
treeb414c17b43b098b92b27cb1bb2cf1ffe40644f0c /app/models/namespace.rb
parentedd2143d35d439e203d53b5e413f71e9f02db139 (diff)
downloadgitlab-ce-65b9768ccfbdc3de682d66430601cf3af1b2a2f8.tar.gz
Group ownership completely based on users_groups relation now
Before we have only owner_id to determine group owner With multiple owners per group we should get rid of owner_id in group. So from now @group.owner will always be nil but @group.owners return an actual array of users who can admin this group
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 18959166931..6ac94c06604 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -20,7 +20,7 @@ class Namespace < ActiveRecord::Base
has_many :projects, dependent: :destroy
belongs_to :owner, class_name: "User"
- validates :owner, presence: true
+ validates :owner, presence: true, unless: ->(n) { n.type == "Group" }
validates :name, presence: true, uniqueness: true,
length: { within: 0..255 },
format: { with: Gitlab::Regex.name_regex,