class Druid::Having::HavingsValidator
Constants
- TYPES
Public Instance Methods
validate_each(record, attribute, value)
click to toggle source
# File lib/druid/having.rb, line 10 def validate_each(record, attribute, value) if TYPES.include?(record.queryType) value.each(&:valid?) # trigger validation value.each do |avalue| avalue.errors.messages.each do |k, v| record.errors.add(attribute, { k => v }) end end else record.errors.add(attribute, "is not supported by type=#{record.queryType}") if value end end