Module: DataMapper::Validate

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

### Methods

all_valid? errors included recursive_valid? save save_self update valid? valid_for_default? validatable? validation_association_keys validation_property validation_property_value

### Included Modules

Context

### Classes and Modules

Module DataMapper::Validate::AutoValidate
Module DataMapper::Validate::ClassMethods
Module DataMapper::Validate::Context
Module DataMapper::Validate::Format
Module DataMapper::Validate::ValidatesAbsent
Module DataMapper::Validate::ValidatesFormat
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::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

errors()

Return the ValidationErrors

recursive_valid?(target, context, state)

Do recursive validity checking

save(context = default_validation_context)
save_self(*)
update(attributes = {}, context = default_validation_context)
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]