Class: CarrierWave::Validations::ActiveModel::IntegrityValidator

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

Overview

end

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



25
26
27
28
29
# File 'lib/carrierwave/validations/active_model.rb', line 25

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