Sha256: e016d6e37e99241fb128e43fdcef4b4123e07d3e474d5f89b1262085d52b162d

Contents?: true

Size: 316 Bytes

Versions: 5

Compression:

Stored size: 316 Bytes

Contents

class ExcludedFromValidation < Validation
  def self.validate(params, field, name, value, record, errors)
    prohibited_values = params['prohibited_values']
    errors[field.name] << new(prohibited_values) if prohibited_values.include?(value)
  end

  def describe
    "must not be: #{params.join(', ')}"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yodel-0.0.7 lib/yodel/models/core/validations/excluded_from_validation.rb
yodel-0.0.4 lib/yodel/models/core/validations/excluded_from_validation.rb
yodel-0.0.3 lib/yodel/models/core/validations/excluded_from_validation.rb
yodel-0.0.2 lib/yodel/models/core/validations/excluded_from_validation.rb
yodel-0.0.1 lib/yodel/models/core/validations/excluded_from_validation.rb