module ActiveModel::Validations

def valid?(context = nil)

to test against (the context is defined on the validations using :on).
otherwise false. Context can optionally be supplied to define which callbacks
Runs all the specified validations and returns true if no errors were added
def valid?(context = nil)
  current_context, self.validation_context = validation_context, context
  errors.clear
  run_validations!
ensure
  self.validation_context = current_context
end