Module: DataMapper::Validate

Module | DataMapper::Validate
In: | lib/dm-validations.rb lib/dm-validations/absent_field_validator.rb lib/dm-validations/acceptance_validator.rb lib/dm-validations/auto_validate.rb lib/dm-validations/block_validator.rb lib/dm-validations/confirmation_validator.rb lib/dm-validations/contextual_validators.rb lib/dm-validations/custom_validator.rb lib/dm-validations/format_validator.rb lib/dm-validations/formats/email.rb lib/dm-validations/formats/url.rb lib/dm-validations/generic_validator.rb lib/dm-validations/length_validator.rb lib/dm-validations/method_validator.rb lib/dm-validations/numeric_validator.rb lib/dm-validations/primitive_validator.rb lib/dm-validations/required_field_validator.rb lib/dm-validations/uniqueness_validator.rb lib/dm-validations/validation_errors.rb lib/dm-validations/within_validator.rb

### Methods

all_valid? check_validations errors included recursive_valid? save! valid? valid_for_default? validatable? validation_association_keys validation_property validation_property_value

### Classes and Modules

Module DataMapper::Validate::AutoValidate
Module DataMapper::Validate::ClassMethods
Module DataMapper::Validate::Format
Module DataMapper::Validate::ValidatesAbsent
Module DataMapper::Validate::ValidatesFormat
Module DataMapper::Validate::ValidatesFormatOf
Module DataMapper::Validate::ValidatesIsAccepted
Module DataMapper::Validate::ValidatesIsConfirmed
Module DataMapper::Validate::ValidatesIsNumber
Module DataMapper::Validate::ValidatesIsPrimitive
Module DataMapper::Validate::ValidatesIsUnique
Module DataMapper::Validate::ValidatesLength
Module DataMapper::Validate::ValidatesPresent
Module DataMapper::Validate::ValidatesWithBlock
Module DataMapper::Validate::ValidatesWithMethod
Module DataMapper::Validate::ValidatesWithin
Class DataMapper::Validate::AbsentFieldValidator
Class DataMapper::Validate::AcceptanceValidator
Class DataMapper::Validate::ConfirmationValidator
Class DataMapper::Validate::ContextualValidators
Class DataMapper::Validate::CustomValidator
Class DataMapper::Validate::FormatValidator
Class DataMapper::Validate::GenericValidator
Class DataMapper::Validate::LengthValidator
Class DataMapper::Validate::MethodValidator
Class DataMapper::Validate::NumericValidator
Class DataMapper::Validate::PrimitiveValidator
Class DataMapper::Validate::RequiredFieldValidator
Class DataMapper::Validate::UniquenessValidator
Class DataMapper::Validate::ValidationErrors
Class DataMapper::Validate::WithinValidator

### Public Class methods

included(model)

### Public Instance methods

all_valid?(context = :default)

Begin a recursive walk of the model checking validity

check_validations(context = :default)

Ensures the object is valid for the context provided, and otherwise throws :halt and returns false.

errors()

Return the ValidationErrors

recursive_valid?(target, context, state)

Do recursive validity checking

save!()

Calls save with a context of nil, thus skipping validations.

valid?(context = :default)

Check if a resource is valid in a given context

valid_for_default?()

Alias for valid?(:default)

validatable?()

Mark this resource as validatable. When we validate associations of a resource we can check if they respond to validatable? before trying to recursivly validate them

validation_association_keys(name)
validation_property(field_name)

Get the corresponding Resource property, if it exists.

Note: DataMapper validations can be used on non-DataMapper resources. In such cases, the return value will be nil.

validation_property_value(name)

[Validate]