summaryrefslogtreecommitdiff
path: root/app/models/group.rb
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-03-07 11:40:27 +0000
committerPhil Hughes <me@iamphill.com>2017-03-07 11:40:27 +0000
commit12fe94c388ae9ec73e34852ef7d7b90f2f347df7 (patch)
tree5182f89deddf9428b1d6ca70720f8ac8ee2b940a /app/models/group.rb
parent002d3a3e72de57c76a077ed5d09e857243c7effd (diff)
parentac9d792946deb17a402646e5481087e4d92f88ad (diff)
downloadgitlab-ce-12fe94c388ae9ec73e34852ef7d7b90f2f347df7.tar.gz
Merge branch 'master' into 26732-combine-deploy-keys-and-push-rules-and-mirror-repository-and-protect-branches-settings-pages26732-combine-deploy-keys-and-push-rules-and-mirror-repository-and-protect-branches-settings-pages
Diffstat (limited to 'app/models/group.rb')
-rw-r--r--app/models/group.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index 7d23f655225..bd0ecae3da4 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -28,6 +28,7 @@ class Group < Namespace
validates :avatar, file_size: { maximum: 200.kilobytes.to_i }
mount_uploader :avatar, AvatarUploader
+ has_many :uploads, as: :model, dependent: :destroy
after_create :post_create_hook
after_destroy :post_destroy_hook
@@ -212,4 +213,14 @@ class Group < Namespace
def users_with_parents
User.where(id: members_with_parents.select(:user_id))
end
+
+ def mattermost_team_params
+ max_length = 59
+
+ {
+ name: path[0..max_length],
+ display_name: name[0..max_length],
+ type: public? ? 'O' : 'I' # Open vs Invite-only
+ }
+ end
end