module
ActiveRecord::Validations
v7.2.3 -
Show latest stable
Active Record Validations
Active Record includes the majority of its validations from ActiveModel::Validations.
In Active Record, all validations are performed on save by default. Validations accept the :on argument to define the context where the validations are active. Active Record will pass either the context of :create or :update depending on whether the model is a {new_record?}[rdoc-ref:Persistence#new_record?].
Files
- activerecord/lib/active_record/validations.rb
- activerecord/lib/active_record/validations/absence.rb
- activerecord/lib/active_record/validations/associated.rb
- activerecord/lib/active_record/validations/length.rb
- activerecord/lib/active_record/validations/numericality.rb
- activerecord/lib/active_record/validations/presence.rb
- activerecord/lib/active_record/validations/uniqueness.rb