Sha256: 1c44f4f94e6d2ad344ebfa30468eecd7ed3f3fca3c2fe2f2a72979fb4a48b384

Contents?: true

Size: 236 Bytes

Versions: 5

Compression:

Stored size: 236 Bytes

Contents

class RequiredValidation < Validation
  def self.validate(params, field, name, value, record, errors)
    errors[field.name] << new(params) if (value.blank? && !value.is_a?(FalseClass))
  end

  def describe
    "is required"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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