Welcome to mirror list, hosted at ThFree Co, Russian Federation.

top_level_group_validator.rb « validators « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b50c9dca154f2ac9b6dc3e7f3c5229f4e370ea5f (plain)
1
2
3
4
5
6
7
8
9
# frozen_string_literal: true

class TopLevelGroupValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    if value&.subgroup?
      record.errors.add(attribute, "must be a top level Group")
    end
  end
end