Methods

Class Index [+]

Quicksearch

DataMapper::Validations::AbsenceValidator

@author Guy van den Berg @since 0.9

Public Instance Methods

call(target) click to toggle source
    # File lib/dm-validations/validators/absent_field_validator.rb, line 8
 8:       def call(target)
 9:         value = target.validation_property_value(field_name)
10:         return true if DataMapper::Ext.blank?(value)
11: 
12:         error_message = (
13:           self.options[:message] || ValidationErrors.default_error_message(
14:             :absent, field_name
15:           )
16:         )
17: 
18:         add_error(target, error_message, field_name)
19:         false
20:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.