Class: CarrierWave::Validations::ActiveModel::ProcessingValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/carrierwave/validations/active_model.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



16
17
18
19
20
# File 'lib/carrierwave/validations/active_model.rb', line 16

def validate_each(record, attribute, value)
  if record.send("#{attribute}_processing_error")
    record.errors.add(attribute, :carrierwave_processing_error)
  end
end