mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-15 21:39:00 +00:00
10 lines
241 B
Ruby
10 lines
241 B
Ruby
# 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
|