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: 7e2e735e0cf605dc5e94b2ddb8472cb40ee3e4c7 (plain)
1
2
3
4
5
6
7
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