Sha256: d39bd315196726dc529f3efc164ccf7c48f4a4b0b42f11f1cacadfdfa80d1d47

Contents?: true

Size: 307 Bytes

Versions: 1

Compression:

Stored size: 307 Bytes

Contents

class AttachmentPresenceValidator < RailsUploads::Validators::Base
  
  # validates :attr, :attachment_presence => true
  
  def validate_each(record, attribute, value)
    unless value.present? and value.exists?
      add_error record, attribute, 'errors.messages.attachment_presence'
    end
  end  

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_uploads-0.1.5 lib/rails_uploads/validators/attachment_presence_validator.rb