Class: Druid::Query::FilterValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- Druid::Query::FilterValidator
- Defined in:
- lib/druid/query.rb
Constant Summary collapse
- TYPES =
%w(timeseries search groupBy select topN)
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
205 206 207 208 209 210 211 212 213 214 |
# File 'lib/druid/query.rb', line 205 def validate_each(record, attribute, value) if value && TYPES.include?(record.queryType) value.valid? # trigger validation value.errors..each do |k, v| record.errors.add(attribute, { k => v }) end else record.errors.add(attribute, "is not supported by type=#{record.queryType}") if value end end |