summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/config/node/validators.rb
blob: 36d48394a8ce154e639779a934a78f90759615ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Gitlab
  module Ci
    class Config
      module Node
        module Validators
          class ArrayOfStringsValidator < ActiveModel::EachValidator
            include LegacyValidationHelpers

            def validate_each(record, attribute, value)
              unless validate_array_of_strings(value)
                record.errors.add(attribute, 'should be an array of strings')
              end
            end
          end
        end
      end
    end
  end
end