Sha256: b273509ef926ae92b189f5a0ac18b7200d1f4e68be14b7632e6ce9df506f4dd1

Contents?: true

Size: 226 Bytes

Versions: 10

Compression:

Stored size: 226 Bytes

Contents

# frozen_string_literal: true
class AsciiOnlyValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    if value && !value.ascii_only?
      record.errors.add(attribute, :ascii)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
shipit-engine-0.39.0 app/validators/ascii_only_validator.rb
shipit-engine-0.38.0 app/validators/ascii_only_validator.rb
shipit-engine-0.37.0 app/validators/ascii_only_validator.rb
shipit-engine-0.36.1 app/validators/ascii_only_validator.rb
shipit-engine-0.36.0 app/validators/ascii_only_validator.rb
shipit-engine-0.35.1 app/validators/ascii_only_validator.rb
shipit-engine-0.35.0 app/validators/ascii_only_validator.rb
shipit-engine-0.34.0 app/validators/ascii_only_validator.rb
shipit-engine-0.33.0 app/validators/ascii_only_validator.rb
shipit-engine-0.32.0 app/validators/ascii_only_validator.rb