Module: DataMapper::Validations::ValidatesNumericality

### Home Classes Methods

### In Files

- lib/dm-validations/validators/numeric_validator.rb

### Methods

- #validates_numericality_of

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- DataMapper
- DataMapper::InvalidContextError
- DataMapper::Validate
- DataMapper::ValidationError
- DataMapper::Validations
- DataMapper::Validations::AbsenceValidator
- DataMapper::Validations::AcceptanceValidator
- DataMapper::Validations::AutoValidations
- DataMapper::Validations::AutoValidations::ModelExtension
- DataMapper::Validations::ClassMethods
- DataMapper::Validations::ConfirmationValidator
- DataMapper::Validations::Context
- DataMapper::Validations::ContextualValidators
- DataMapper::Validations::Format
- DataMapper::Validations::Format::Email
- DataMapper::Validations::Format::Url
- DataMapper::Validations::FormatValidator
- DataMapper::Validations::GenericValidator
- DataMapper::Validations::LengthValidator
- DataMapper::Validations::MethodValidator
- DataMapper::Validations::NumericalityValidator
- DataMapper::Validations::OrderedHash
- DataMapper::Validations::PresenceValidator
- DataMapper::Validations::PrimitiveTypeValidator
- DataMapper::Validations::UniquenessValidator
- DataMapper::Validations::UnknownValidationFormat
- DataMapper::Validations::ValidatesAbsence
- DataMapper::Validations::ValidatesAcceptance
- DataMapper::Validations::ValidatesConfirmation
- DataMapper::Validations::ValidatesFormat
- DataMapper::Validations::ValidatesLength
- DataMapper::Validations::ValidatesNumericality
- DataMapper::Validations::ValidatesPresence
- DataMapper::Validations::ValidatesPrimitiveType
- DataMapper::Validations::ValidatesUniqueness
- DataMapper::Validations::ValidatesWithBlock
- DataMapper::Validations::ValidatesWithMethod
- DataMapper::Validations::ValidatesWithin
- DataMapper::Validations::ValidationErrors
- DataMapper::Validations::WithinValidator
- Object

No matching classes.

# DataMapper::Validations::ValidatesNumericality

### Public Instance Methods

validates_numericality_of(*fields) click to toggle source

Validate whether a field is numeric.

@option [Boolean] :allow_nil

    true if number can be nil, false if not.

@option [Boolean] :allow_blank

    true if number can be blank, false if not.

@option [String] :message

    Custom error message, also can be a callable object that takes
    an object (for pure Ruby objects) or object and property
    (for DM resources).

@option [Numeric] :precision

    Required precision of a value.

@option [Numeric] :scale

    Required scale of a value.

@option [Numeric] :gte

    'Greater than or equal to' requirement.

@option [Numeric] :lte

    'Less than or equal to' requirement.

@option [Numeric] :lt

    'Less than' requirement.

@option [Numeric] :gt

    'Greater than' requirement.

@option [Numeric] :eq

    'Equal' requirement.

@option [Numeric] :ne

    'Not equal' requirement.

@option [Boolean] :integer_only

    Use to restrict allowed values to integers.

    # File lib/dm-validations/validators/numeric_validator.rb, line 175
    def validates_numericality_of(*fields)
      validators.add(NumericalityValidator, *fields)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.