Method: Brief::DocumentMapper::Query#run_query
- Defined in:
- lib/brief/document_mapper.rb
#run_query ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/brief/document_mapper.rb', line 72 def run_query if query_is_empty? select else model.select do |obj| match = true @where.each do |selector, value| if obj.respond_to?(selector.attribute) test_value = obj.send(selector.attribute) operator = OPERATOR_MAPPING[selector.operator] match = false unless test_value.send(operator, value) else match = false end end match end end end |