Class: Mincer::PgSearch::SearchEngines::Array
- Defined in:
- lib/mincer/processors/pg_search/search_engines/array.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#arel_group, #engine_sym, #initialize, #prepared_search_statements, #quote, #rank, #sanitize_column, #sanitize_string, #sanitize_string_quoted, #search_engine_statements
Methods included from Mincer::Processors::Helpers
Constructor Details
This class inherits a constructor from Mincer::PgSearch::SearchEngines::Base
Instance Method Details
#conditions ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/mincer/processors/pg_search/search_engines/array.rb', line 6 def conditions return nil unless prepared_search_statements.any? arel_group do conditions = prepared_search_statements.map do |search_statement| if search_statement.pattern = args[search_statement.param_name] terms_delimiter = search_statement.[:any_word] ? '&&' : '@>' arel_group(Arel::Nodes::InfixOperation.new(terms_delimiter, document_for(search_statement), query_for(search_statement))) end end join_expressions(conditions, :or) end end |