Class: ActiveModel::Validations::NotNullValidator
- Inherits:
-
EachValidator
- Object
- EachValidator
- ActiveModel::Validations::NotNullValidator
- Defined in:
- lib/active_model/validations/not_null.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/active_model/validations/not_null.rb', line 4 def validate_each(record, attribute, value) if value.nil? = .except(:must_be_set) = [:must_be_set] [:message] ||= if record.errors.add(attribute, :must_be_set, ) end end |