module ActiveRecord::Validations
def valid?(context = nil)
\Validations with no :on option will run no matter the context. \Validations with
run within multiple contexts.
If the argument is an array of contexts, post.valid?([:create, :update]), the validations are
{new_record?}[rdoc-ref:Persistence#new_record?] is +true+, and to :update if it is not.
If the argument is +false+ (default is +nil+), the context is set to :create if
Aliased as #validate.
no errors are found, +false+ otherwise.
Runs all the validations within the specified context. Returns +true+ if
def valid?(context = nil) context ||= default_validation_context output = super(context) errors.empty? && output end