class ZohoHub::Validations::ValidateLength

Public Instance Methods

validate(options = {}) click to toggle source
# File lib/zoho_hub/validations/validate_length.rb, line 8
def validate(options = {})
  value = record.send(field)

  return unless value

  return if value.size <= options[:length]

  record.add_error(field, 'is too long')
end