Class: ActiveModel::Validations::PresenceValidator

Inherits:
EachValidator show all
Defined in:
lib/active_model/validations/presence.rb

Instance Attribute Summary

Attributes inherited from EachValidator

#attributes

Attributes inherited from ActiveModel::Validator

#options

Instance Method Summary collapse

Methods inherited from EachValidator

#check_validity!, #initialize, #validate_each

Methods inherited from ActiveModel::Validator

#initialize, kind, #kind

Constructor Details

This class inherits a constructor from ActiveModel::EachValidator

Instance Method Details

#validate(record) ⇒ Object



8
9
10
# File 'lib/active_model/validations/presence.rb', line 8

def validate(record)
  record.errors.add_on_blank(attributes, options)
end