Class: NotAllowedValidationRule
Instance Method Summary
collapse
#get_field_value, #is_required?
Instance Method Details
#error_message(field, attributes = {}) ⇒ Object
449
450
451
452
453
454
455
456
457
|
# File 'lib/validation_profiler/rules/rules.rb', line 449
def error_message(field, attributes = {})
if attributes[:message] == nil
"#{field} is not allowed."
else
attributes[:message]
end
end
|
#validate(obj, field, attributes = {}) ⇒ Object
460
461
462
463
464
465
466
467
468
469
470
471
|
# File 'lib/validation_profiler/rules/rules.rb', line 460
def validate(obj, field, attributes = {})
field_value = get_field_value(obj, field)
if field_value != nil
return false
end
return true
end
|