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.5.27 lib/workarea/validators/parameter_validator.rb
workarea-core-3.5.26 lib/workarea/validators/parameter_validator.rb
workarea-core-3.4.45 lib/workarea/validators/parameter_validator.rb
workarea-core-3.5.25 lib/workarea/validators/parameter_validator.rb
workarea-core-3.5.23 lib/workarea/validators/parameter_validator.rb
workarea-core-3.4.44 lib/workarea/validators/parameter_validator.rb
workarea-core-3.5.22 lib/workarea/validators/parameter_validator.rb
workarea-core-3.4.43 lib/workarea/validators/parameter_validator.rb
workarea-core-3.5.21 lib/workarea/validators/parameter_validator.rb
workarea-core-3.4.42 lib/workarea/validators/parameter_validator.rb
workarea-core-3.5.20 lib/workarea/validators/parameter_validator.rb
workarea-core-3.4.41 lib/workarea/validators/parameter_validator.rb
workarea-core-3.5.19 lib/workarea/validators/parameter_validator.rb
workarea-core-3.4.40 lib/workarea/validators/parameter_validator.rb
workarea-core-3.5.18 lib/workarea/validators/parameter_validator.rb
workarea-core-3.4.39 lib/workarea/validators/parameter_validator.rb
workarea-core-3.5.17 lib/workarea/validators/parameter_validator.rb
workarea-core-3.4.38 lib/workarea/validators/parameter_validator.rb
workarea-core-3.5.16 lib/workarea/validators/parameter_validator.rb
workarea-core-3.4.37 lib/workarea/validators/parameter_validator.rb