Class: Gitlab::Config::Entry::Validators::TypeValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Gitlab::Config::Entry::Validators::TypeValidator
- Defined in:
- lib/gitlab/config/entry/validators.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
308 309 310 311 312 313 314 315 316 |
# File 'lib/gitlab/config/entry/validators.rb', line 308 def validate_each(record, attribute, value) type = [:with] raise unless type.is_a?(Class) unless value.is_a?(type) = [:message] || "should be a #{type.name}" record.errors.add(attribute, ) end end |