Sha256: 454e703becd3b79e5935958343c2ed19486c0aa7eb25ab2cb03c526aa3aac6ab

Contents?: true

Size: 287 Bytes

Versions: 6

Compression:

Stored size: 287 Bytes

Contents

module ActiveModel
  module Validations
    class BlankValidator < ActiveModel::EachValidator
      def validate_each(record, attribute, value)
        unless value.blank?
          record.errors.add attribute, options[:message] || :must_be_blank
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activemodel-validators-3.0.1 lib/activemodel-validators/blank_validator.rb
activemodel-validators-3.0.0 lib/activemodel-validators/blank_validator.rb
activemodel-validators-2.0.0 lib/activemodel-validators/blank_validator.rb
activemodel-validators-1.2.0 lib/activemodel-validators/blank_validator.rb
activemodel-validators-1.1.0 lib/activemodel-validators/blank_validator.rb
activemodel-validators-1.0.0 lib/activemodel-validators/blank_validator.rb