Sha256: 4cf8661811c3d234f3dbe3d747ecd4a9edc0f1dd72203c0bd4494a179600d8aa

Contents?: true

Size: 227 Bytes

Versions: 2

Compression:

Stored size: 227 Bytes

Contents

module Bulb
  class UnexistingValidator < ActiveModel::EachValidator
    def validate_each(record, attribute, value)
      if File.exist?(value)
        record.errors.add attribute, 'must not exist'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bulb-0.5.0 app/validators/bulb/unexisting_validator.rb
bulb-0.4.0 app/validators/bulb/unexisting_validator.rb