Sha256: f42ada9217ccfefc94ce78651319475c4549bf141adf7456f3654ef0fa001624

Contents?: true

Size: 254 Bytes

Versions: 9

Compression:

Stored size: 254 Bytes

Contents

class AttachmentPresenceValidator < RailsUploads::Validators::Base
  
  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

9 entries across 9 versions & 1 rubygems

Version Path
rails_uploads-0.2.8 lib/rails_uploads/validators/attachment_presence_validator.rb
rails_uploads-0.2.7 lib/rails_uploads/validators/attachment_presence_validator.rb
rails_uploads-0.2.6 lib/rails_uploads/validators/attachment_presence_validator.rb
rails_uploads-0.2.5 lib/rails_uploads/validators/attachment_presence_validator.rb
rails_uploads-0.2.4 lib/rails_uploads/validators/attachment_presence_validator.rb
rails_uploads-0.2.3 lib/rails_uploads/validators/attachment_presence_validator.rb
rails_uploads-0.2.2 lib/rails_uploads/validators/attachment_presence_validator.rb
rails_uploads-0.2.1 lib/rails_uploads/validators/attachment_presence_validator.rb
rails_uploads-0.2.0 lib/rails_uploads/validators/attachment_presence_validator.rb