Class: Paperclip::Validate::RequiredFieldValidator
- Inherits:
-
DataMapper::Validate::GenericValidator
- Object
- DataMapper::Validate::GenericValidator
- Paperclip::Validate::RequiredFieldValidator
- Defined in:
- lib/dm-paperclip/validations.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#call(target) ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'lib/dm-paperclip/validations.rb', line 55 def call(target) field_value = target.validation_property_value(@field_name) if field_value.nil? || field_value.original_filename.blank? = @options[:message] || sprintf("%s must be set", @field_name.to_s.humanize) add_error(target, , @field_name) return false end return true end |