Sha256: 32848053b85b9fbb284cf7fa97a69340a959b47cd6098a6b2ffd4278ce1a54a5

Contents?: true

Size: 275 Bytes

Versions: 62

Compression:

Stored size: 275 Bytes

Contents

class ParameterValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    unless value =~ /^[\w\-]+$/
      record.errors[attribute] << <<-eos
        must contain only alphanumeric, underscore, and hyphen characters
      eos
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.4.13 lib/workarea/validators/parameter_validator.rb
workarea-core-3.4.12 lib/workarea/validators/parameter_validator.rb