Class: SearchCopGrammar::AnywhereExpression
- Inherits:
-
BaseNode
- Object
- Treetop::Runtime::SyntaxNode
- BaseNode
- SearchCopGrammar::AnywhereExpression
- Defined in:
- lib/search_cop_grammar.rb
Direct Known Subclasses
DoubleQuotedAnywhereExpression, SingleQuotedAnywhereExpression
Instance Attribute Summary
Attributes inherited from BaseNode
Instance Method Summary collapse
Methods inherited from BaseNode
Instance Method Details
#evaluate ⇒ Object
89 90 91 92 93 94 95 |
# File 'lib/search_cop_grammar.rb', line 89 def evaluate queries = query_info.scope.reflection.default_attributes.keys.collect { |key| collection_for key }.select { |collection| collection.compatible? text_value }.collect { |collection| collection.matches text_value } raise SearchCop::NoSearchableAttributes if queries.empty? queries.flatten.inject(:or) end |