diff options
author | Phil Hughes <me@iamphill.com> | 2017-03-07 11:40:27 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-03-07 11:40:27 +0000 |
commit | 12fe94c388ae9ec73e34852ef7d7b90f2f347df7 (patch) | |
tree | 5182f89deddf9428b1d6ca70720f8ac8ee2b940a /app/models/group.rb | |
parent | 002d3a3e72de57c76a077ed5d09e857243c7effd (diff) | |
parent | ac9d792946deb17a402646e5481087e4d92f88ad (diff) | |
download | gitlab-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.rb | 11 |
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 |