diff options
author | Micaël Bergeron <mbergeron@gitlab.com> | 2018-01-29 12:57:34 -0500 |
---|---|---|
committer | Micaël Bergeron <mbergeron@gitlab.com> | 2018-02-01 12:14:46 -0500 |
commit | 2057a6acdee7c1f6824ff6289b0d979e8cb15f35 (patch) | |
tree | 25b911b147bfa0797dfee4cacf99f23ae5f55281 /app/models/group.rb | |
parent | 402f3dfc0a962dc89d8334d4d61410e67e14a55f (diff) | |
download | gitlab-ce-2057a6acdee7c1f6824ff6289b0d979e8cb15f35.tar.gz |
port of 594e6a0a625^..f74c90f68c6
Diffstat (limited to 'app/models/group.rb')
-rw-r--r-- | app/models/group.rb | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/app/models/group.rb b/app/models/group.rb index fddace03387..415507a6aea 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -29,17 +29,14 @@ class Group < Namespace has_many :variables, class_name: 'Ci::GroupVariable' has_many :custom_attributes, class_name: 'GroupCustomAttribute' - validate :avatar_type, if: ->(user) { user.avatar.present? && user.avatar_changed? } + has_many :uploads, as: :model, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent + validate :visibility_level_allowed_by_projects validate :visibility_level_allowed_by_sub_groups validate :visibility_level_allowed_by_parent - validates :avatar, file_size: { maximum: 200.kilobytes.to_i } - validates :two_factor_grace_period, presence: true, numericality: { greater_than_or_equal_to: 0 } - mount_uploader :avatar, AvatarUploader - has_many :uploads, as: :model, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent after_create :post_create_hook after_destroy :post_destroy_hook @@ -116,12 +113,6 @@ class Group < Namespace visibility_level_allowed_by_sub_groups?(level) end - def avatar_url(**args) - # We use avatar_path instead of overriding avatar_url because of carrierwave. - # See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11001/diffs#note_28659864 - avatar_path(args) - end - def lfs_enabled? return false unless Gitlab.config.lfs.enabled return Gitlab.config.lfs.enabled if self[:lfs_enabled].nil? |